Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to copy a File from local System to HDFS?

  • //To create a new directory
    Sample Code Segment

    Path sourcepath = new Path("user/D/filelLocation");
    Path despath = new Path("hdfs://slogix.in:54310/home/hduser/hadoopfile”);
    FileSystem fs = FileSystem.get(conf);
    fs.copyFromLocalFile(sourcepath, despath);

    Command

    hadoop fs -copyFromLocal <sourcepath> <despath>