Write data into HDFS with Java
In previous post I show how to setup and configure hadoop 3.0 simple cluster Now we can read and write into HDFS with Java: Create dir into HDFS (from master node) # hadoop fs -mkdir -p /user/data # hadoop fs -ls /user/data 2018-02-19 18:17:58,784 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform ... using builtin-java classes where applicable HadoopSimple.java package gdev; import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import org.apache.commons.io.IOUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.util.Progressable; import org.apache.log4j.Logger; import java.net.URI; public class HadoopSimple { final static Logger logger = Logger.getLogger(Hadoop...