设为首页 加入收藏

TOP

Java Hadoop分布式系统文件操作(二)
2014-11-23 21:36:30 来源: 作者: 【 】 浏览:45
Tags:Java Hadoop 分布式 系统 文件 操作
tStream os = null;
Path f = new Path(ROOT_PATH + path);
os = fs.create(f,true);
os.writeBytes(string);

os.close();
fs.close();
return true;
}


public static void main(String[] args)
{
try {
DFSOperator.createFile("/lory/test1.txt", true);
DFSOperator.deleteFile("/dfs_operator.txt", true);
DFSOperator.writeStringToDFSFile("/lory/test1.txt", "You are a bad man.\nReally \n");
System.out.println(DFSOperator.readDFSFileToString("/lory/test1.txt"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("===end===");
}
}


--------------------------------------分割线 --------------------------------------


--------------------------------------分割线 --------------------------------------


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇用ExtJS 4.0打造自己的Web桌面 下一篇Java使用SSH执行UNIX命令问题

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: