wiki:waue/2009/1026
close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_core.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.

Version 1 (modified by waue, 15 years ago) (diff)

--

  • ICAS.java 完成 上傳檔案到hdfs的程式
	static boolean upload2HDFS() {
		Configuration conf = new Configuration();
		String hdfs_src = fa_in;
		String local_src = rdc_out + "/parsed";
		Path dstPath = new Path(hdfs_src);
		try {
			FileSystem dstFs = dstPath.getFileSystem(conf);
			dstFs.copyFromLocalFile(false, new Path(local_src), new Path(
					hdfs_src));
			return true;
		} catch (IOException e) {
			e.printStackTrace();
			return false;
		}
	}