I wanted to figure out how to set/change replication factor for a file stored in HDFS, so i built this sample program, which has 3 methods
Once you build the jar you can execute it by using command like this
java -jar target/HelloHDFS-jar-with-dependencies.jar read <hdfsfile_path>
Ex. In my case i have aesop.txt at hdfs://localhost/user/user/aesop.txt so i can print it by using following command
java -jar target/HelloHDFS-jar-with-dependencies.jar read aesop.txt