|
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class HdfsClientDemo {
public static void main(String[] args) throws Exception{
Configuration conf = new Configuration();
conf.set("dfs.replication", "64m");
conf.set("dfs.blocksize", "2");
FileSystem fs = FileSystem.get(new URI("hdfs://hdp-00:9000/"), conf, "root");
fs.copyFromLocalFile(new Path("d:/pdftoword.rar"), new Path("/abc/"));
fs.close();
}
}
//出错了。是怎么回事,有人知道吗?
|
|