hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dhruba Borthakur" <dhr...@yahoo-inc.com>
Subject RE: Any one can tell me about how to write to HDFS?
Date Sat, 01 Dec 2007 04:55:11 GMT
There is a dfs shell utility to do this too. Please see if this utility
works on ur cluster. It can be used as follows:

Bin/hadoop dfs -copyFromLocal <localfile> <dfs path>

Please see if it works on you cluster. If it does, then please compare
the method org.apache.hadoop.fs.FsShell.copyFromLocal() with your code.

Thanks,
dhruba 

-----Original Message-----
From: Raghu Angadi [mailto:rangadi@yahoo-inc.com] 
Sent: Friday, November 30, 2007 8:49 PM
To: hadoop-user@lucene.apache.org
Subject: Re: Any one can tell me about how to write to HDFS?


try 'Path outFile = new Path("/ryan/test");'
also check if there is any usefule message on Namenode log.

Raghu.

Ryan Wang wrote:
> Hope this version can attract other's attention
> 
> Hadoop Version:  0.15.0
> JDK version: Sun JDK 6.0.3
> Platform: Ubuntu 7.10
> IDE:   Eclipse 3.2
> Code :
> public class HadoopWrite {
> 
>     /**
>      * @param args
>      */
>     public static void main(String[] args) throws IOException{
>         Configuration dfsconf = new Configuration();
>         FileSystem dfs;
>         dfs = FileSystem.get(dfsconf);
>         Path inFile = new Path("/nutch/out");
>         Path outFile = new Path("ryan/test");
>         dfs.copyFromLocalFile(inFile, outFile);
> 
>     }
> 
> }

Mime
View raw message