You don't need to add anything to the classpath, but you need to use
the configuration in the org.apache.whirr.service.Cluster object to
populate your Hadoop Configuration object so that your code knows
which cluster to connect to. See the getConfiguration() method in
HadoopServiceController for how to do this.

Cheers,
Tom

On Thu, Jan 27, 2011 at 12:21 PM,  <praveen.pe...@nokia.com> wrote:
> Hello all,
> I wrote a java class HadoopLanucher that is very similar to
> HadoopServiceController. I was succesfully able to launch a cluster
> programtically from my application using Whirr. Now I want to copy files to
> hdfs and also run a job progrmatically.
>
> When I copy a file to hdfs its copying to local file system, not hdfs. Here
> is the code I used:
>
> Configuration conf = new Configuration();
> FileSystem hdfs = FileSystem.get(conf);
> hdfs.copyFromLocalFile(false, true, new Path(localFilePath), new
> Path(hdfsFileDirectory));
>
> Do I need to add anything else to the classpath so Hadoop libraries know
> that it needs to talk to the dynamically lanuched cluster? When running
> Whirr from command line I know it uses HADOOP_CONF_DIR to find the hadoop
> config files but when doing the same from Java I am wondering how to solve
> this issue.
>
> Praveen
>
>

Reply via email to