Hello all,

I need to copy files from my linux file system to HDFS in a java program and
not manually. This is the piece of code that I have.

try {

                        FileSystem hdfs = FileSystem.get(new Configuration());
                        
                        LocalFileSystem ls = null;
                        
                        ls = hdfs.getLocal(hdfs.getConf());
                        
                        hdfs.copyFromLocalFile(false, new Path(fileName), new 
Path(outputFile));

                } catch (Exception e) {
                        e.printStackTrace();
                }

The problem is that it searches for the input path on the HDFS and not my
linux file system.

Can someone point out where I may be wrong. I feel it's some configuration
issue but have not been able to figure it out. 

Thanks.
-- 
View this message in context: 
http://www.nabble.com/How-do-I-copy-files-from-my-linux-file-system-to-HDFS-using-a-java-prog--tp16992491p16992491.html
Sent from the Hadoop core-user mailing list archive at Nabble.com.

Reply via email to