Create a directory on the remote HDFS from localhost
Written code but don't understand what and where to write the core-site.xml
and the hdfs-site.xml
.
public class HadoopCall {
public void demomkdir(String dir) throws IOException
{
Configuration obj = new Configuration();
obj.set("fs.defaultFS", "http://datlpdsnn01.pds.in.****.com:50070/");
FileSystem fs = FileSystem.get(obj);
Path pth = new Path(dir);
fs.mkdirs(pth);
System.out.println("created");
fs.close();
}
public static void main(String[] args) throws IOException {
HadoopCall oj = new HadoopCall();
oj.demomkdir("user/*******/javacodemkdir");
}
}