31683/how-to-delete-a-file-from-hadoop-hdfs-using-java
I know that I can delete a file using this command:
hdfs dfs -rm -r hdfs://path/to/file
I want to know how to do this in Java. Can someone tell me how to do this?
Try this:
FileSystem fs = FileSystem.get(getConf()); fs.delete(new Path("path/to/file"), true);
Define the HADOOP_CONF_DIR environment variable to your Hadoop configuration ...READ MORE
The distributed copy command, distcp, is a ...READ MORE
Just try the following command: hadoop fs -rm ...READ MORE
You could pass the URI when getting ...READ MORE
du command is used for to see ...READ MORE
Hadoop put & appendToFile only reads standard ...READ MORE
You can use dfsadmin which runs a ...READ MORE
hdfs dfsadmin -report This command tells fs ...READ MORE
Just use the FileSystem's copyFromLocalFile method. If the source Path ...READ MORE
Try this: Configuration conf = new Configuration(); ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.