You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Murali Vemulapati <mv...@yahoo-inc.com> on 2008/11/10 20:38:30 UTC

barrier example

I believe there is a typo in the barrier example given at:

http://hadoop.apache.org/zookeeper/docs/current/zookeeperTutorial.html

With the following fix, the program runs as expected:
==============
83c83
<                 this.name = new 
String(InetAddress.getLocalHost().getCanonicalHostName().toString());
---
 >                 name = new 
String(InetAddress.getLocalHost().getCanonicalHostName().toString());
100c100
<                     CreateMode.EPHEMERAL_SEQUENTIAL);
---
 >                     CreateMode.EPHEMERAL);
==============
The first change assigns the name to the instance variable 'name' of 
Barrier class (otherwise the 'name' instance variable will have a value 
of 'null'
when calling zk.create to create the child node under the root barrier 
node).
The second change lets us run multiple processes on the same machine.

thanks
murali


Re: barrier example

Posted by Patrick Hunt <ph...@apache.org>.
I've submitted a patch for this, currently slated to be fixed in 3.1.0 
and the 3.0 branch (3.0.1 fix release)
https://issues.apache.org/jira/browse/ZOOKEEPER-218

Regards,

Patrick

Patrick Hunt wrote:
> Thanks for the feedback Murali, I've entered a JIRA for the issue here:
> 
> https://issues.apache.org/jira/browse/ZOOKEEPER-218
> 
> Patrick
> 
> Murali Vemulapati wrote:
>> I believe there is a typo in the barrier example given at:
>>
>> http://hadoop.apache.org/zookeeper/docs/current/zookeeperTutorial.html
>>
>> With the following fix, the program runs as expected:
>> ==============
>> 83c83
>> <                 this.name = new 
>> String(InetAddress.getLocalHost().getCanonicalHostName().toString());
>> ---
>>  >                 name = new 
>> String(InetAddress.getLocalHost().getCanonicalHostName().toString());
>> 100c100
>> <                     CreateMode.EPHEMERAL_SEQUENTIAL);
>> ---
>>  >                     CreateMode.EPHEMERAL);
>> ==============
>> The first change assigns the name to the instance variable 'name' of 
>> Barrier class (otherwise the 'name' instance variable will have a 
>> value of 'null'
>> when calling zk.create to create the child node under the root barrier 
>> node).
>> The second change lets us run multiple processes on the same machine.
>>
>> thanks
>> murali
>>

Re: barrier example

Posted by Patrick Hunt <ph...@apache.org>.
Thanks for the feedback Murali, I've entered a JIRA for the issue here:

https://issues.apache.org/jira/browse/ZOOKEEPER-218

Patrick

Murali Vemulapati wrote:
> I believe there is a typo in the barrier example given at:
> 
> http://hadoop.apache.org/zookeeper/docs/current/zookeeperTutorial.html
> 
> With the following fix, the program runs as expected:
> ==============
> 83c83
> <                 this.name = new 
> String(InetAddress.getLocalHost().getCanonicalHostName().toString());
> ---
>  >                 name = new 
> String(InetAddress.getLocalHost().getCanonicalHostName().toString());
> 100c100
> <                     CreateMode.EPHEMERAL_SEQUENTIAL);
> ---
>  >                     CreateMode.EPHEMERAL);
> ==============
> The first change assigns the name to the instance variable 'name' of 
> Barrier class (otherwise the 'name' instance variable will have a value 
> of 'null'
> when calling zk.create to create the child node under the root barrier 
> node).
> The second change lets us run multiple processes on the same machine.
> 
> thanks
> murali
>