We use ZK for some incrementing counters and this is method that does it
(this is wrapped in a Thrift call) :

 public long getNextSequenceId()
    {
      Stat stat = null;
      String path = "/<cluster name>/" +  "/SequenceId";
      try
      {
        stat = zk_.setData( path , new byte[0] , -1);
      }
      catch (InterruptedException ie)
      {
        // handle it.
      }
      catch (KeeperException ke)
      {
        // handle it.
      }
      return stat.getMzxid();
    }


Avinash




On Mon, Mar 29, 2010 at 11:40 AM, Eric Hauser <ewhau...@gmail.com> wrote:

> That's good to know.  I've often seen high latency between availability
> zones.
>
> BTW, does anyone from Digg patrol the list?  I'm really interested in some
> additional the implementation of atomic counters with ZooKeeper.
>
>
> On Mon, Mar 29, 2010 at 1:58 PM, Joe Stump <j...@joestump.net> wrote:
>
>>
>> On Mar 29, 2010, at 11:55 AM, Eric Hauser wrote:
>>
>> > Does the information is the below link about Cassandra and replication
>> over WAN have any merit or is it just FUD?
>>
>> I can attest Cassandra works fine over inter-DC connections. We have ~20
>> nodes spread across three Amazon "Availability Zones". I know Digg is doing
>> bi-coastal Cassandra as well without issues.
>>
>> Cassandra was specifically built to work well over WAN / intermittently
>> failing connections / setups.
>>
>> --Joe
>>
>>
>

Reply via email to