hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sugandha Naolekar <sugandha....@gmail.com>
Subject Code not working..!
Date Fri, 12 Jun 2009 06:54:17 GMT
Hello!

****************************************************************8
Following is the code that's not working::

package data.pkg;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.Path;

public class Try
{
    public static void main(String[] args)
    {
        Configuration conf_hdfs=new Configuration();

        try
        {
            FileSystem hdfs_filesystem=FileSystem.get(conf_hdfs);
            FileSystem remote_filesystem=FileSystem.getLocal(conf_hdfs);

            Path in_path =new Path("/home/hadoop/Desktop/test.java");
            Path out_path=new Path("/user/hadoop");

            FileUtil.copy(remote_filesystem,in_path,hdfs_filesystem,
out_path, false, false,conf_hdfs);

            System.out.println("Done...!");
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
    }

 }

************************************************************


What I am trying to do is simply copy a file from a remote node(not a part
of master-slave config file) to HDFS (a cluster of 7 nodes).

But, it's flanking the errors as follws::

*********************************

 File /home/hadoop/Desktop/test.java does not exist.
        at
org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:420)
        at
org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:244)
        at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:192)
        at data.pkg.Try.main(Try.java:24)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:165)
        at org.apache.hadoop.mapred.JobShell.run(JobShell.java:54)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
        at org.apache.hadoop.mapred.JobShell.main(JobShell.java:68)
******************************************************************************

-- 
Regards!
Sugandha

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message