How can I execute hadoop put files in hdfs using Java? That's possible?
Using this statement:
public abstract boolean rename(Path src, Path dst) throws IOException
?
Thanks!
You should be able to use copyFromLocalFile:
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(conf);
Path localPath = new Path("path/to/local/file");
Path hdfsPath = new Path("/path/in/hdfs");
fs.copyFromLocalFile(localPath, hdfsPath);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With