Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +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://”);
    FileSystem fs = FileSystem.get(conf);
    fs.copyFromLocalFile(sourcepath, despath);


    hadoop fs -copyFromLocal <sourcepath> <despath>