You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@whirr.apache.org by Frank Scholten <fr...@frankscholten.nl> on 2011/05/10 12:09:56 UTC

Retrieving the Hadoop Configuration object after launching a cluster with 0.4 API

Hi,

What's the proper way to retrieve the Hadoop Configuration object
after launching a Hadoop cluster via the 0.4 API?

---

Configuration whirrConfiguration = new PropertiesConfiguration(new
File("/home/frank/hadoop.properties"));

clusterSpec = new ClusterSpec(whirrConfiguration, false);
service = new Service();

Cluster cluster = service.launchCluster(clusterSpec);

proxy = new HadoopProxy(clusterSpec, cluster);
proxy.start();

org.apache.hadoop.conf.Configuration hadoopConfiguration = ...

---

Cheers,

Frank

Re: Retrieving the Hadoop Configuration object after launching a cluster with 0.4 API

Posted by Andrei Savu <sa...@gmail.com>.
You should take a look at the Hadoop integration tests for an
alternative that uses the Cluster object for creating a Hadoop
Configuration instance (HadoopServiceController.getConfiguration).

Cheers,

-- Andrei Savu / andreisavu.ro

On Tue, May 10, 2011 at 1:46 PM, Frank Scholten <fr...@frankscholten.nl> wrote:
> org.apache.hadoop.conf.Configuration hadoopConfiguration = new
> org.apache.hadoop.conf.Configuration();
> hadoopConfiguration.addResource(new
> Path(System.getProperty("user.home"), ".whirr/" +
> clusterSpec.getClusterName() + "/" + "hadoop-site.xml"));
>
> This works, just curious if there's a nicer way to do it.
>
> Frank
>
> On Tue, May 10, 2011 at 12:09 PM, Frank Scholten <fr...@frankscholten.nl> wrote:
>> Hi,
>>
>> What's the proper way to retrieve the Hadoop Configuration object
>> after launching a Hadoop cluster via the 0.4 API?
>>
>> ---
>>
>> Configuration whirrConfiguration = new PropertiesConfiguration(new
>> File("/home/frank/hadoop.properties"));
>>
>> clusterSpec = new ClusterSpec(whirrConfiguration, false);
>> service = new Service();
>>
>> Cluster cluster = service.launchCluster(clusterSpec);
>>
>> proxy = new HadoopProxy(clusterSpec, cluster);
>> proxy.start();
>>
>> org.apache.hadoop.conf.Configuration hadoopConfiguration = ...
>>
>> ---
>>
>> Cheers,
>>
>> Frank
>>
>

Re: Retrieving the Hadoop Configuration object after launching a cluster with 0.4 API

Posted by Frank Scholten <fr...@frankscholten.nl>.
org.apache.hadoop.conf.Configuration hadoopConfiguration = new
org.apache.hadoop.conf.Configuration();
hadoopConfiguration.addResource(new
Path(System.getProperty("user.home"), ".whirr/" +
clusterSpec.getClusterName() + "/" + "hadoop-site.xml"));

This works, just curious if there's a nicer way to do it.

Frank

On Tue, May 10, 2011 at 12:09 PM, Frank Scholten <fr...@frankscholten.nl> wrote:
> Hi,
>
> What's the proper way to retrieve the Hadoop Configuration object
> after launching a Hadoop cluster via the 0.4 API?
>
> ---
>
> Configuration whirrConfiguration = new PropertiesConfiguration(new
> File("/home/frank/hadoop.properties"));
>
> clusterSpec = new ClusterSpec(whirrConfiguration, false);
> service = new Service();
>
> Cluster cluster = service.launchCluster(clusterSpec);
>
> proxy = new HadoopProxy(clusterSpec, cluster);
> proxy.start();
>
> org.apache.hadoop.conf.Configuration hadoopConfiguration = ...
>
> ---
>
> Cheers,
>
> Frank
>