Hadoop的HDFS的java客户端编程接口的jar包在哪?
我在网上找到如下示例代码:
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path;
class HDFSClient {
static public void sampleHdfsWrite(String hdfs_url, String file) throws Exception {
FileSystem hdfs = FileSystem.get(new Configuration());
Path localfile = new Path(file);
Path hdfspath = new Path("/");
hdfs.copyFromLocalFile(localfile, hdfspath);
}
static public void sampleHdfsRead(String hdfs_url, String file) throws Exception {
FileSystem hdfs = FileSystem.get(new Configuration());
Path localfile = new Path("./" + file + ".backup");
Pat