A newbie question about DistributedAtomicLong.

75 views
Skip to first unread message

温金超

unread,
Apr 16, 2013, 3:15:58 AM4/16/13
to curato...@googlegroups.com
Hi all,

I have a zk cluster: zk1, zk2 and zk3. suppose I have create a path "/foo/bar/counter" on zk cluster.
And I have a zk client which have 10 threads concurrently call DistributedAtomicLong#add methond on path "/foo/bar/counter".

Is there any way to make sure all of calls succeeded?What RetyPolicy should I use? and PromotedToLock?

Thanks.

jinchao

Jordan Zimmerman

unread,
Apr 16, 2013, 9:06:44 AM4/16/13
to curato...@googlegroups.com
To guarantee, you'd probably need to loop until the add succeeds. Use whatever RetryPolicy you like and definitely use promoted to lock.

-JZ

--
You received this message because you are subscribed to the Google Groups "curator-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to curator-user...@googlegroups.com.
To post to this group, send email to curato...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/curator-users/-/9cQkUcdsI_8J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

温金超

unread,
Apr 16, 2013, 10:55:14 PM4/16/13
to curato...@googlegroups.com
Thanks JZ.

If looping until the add succeeds, it can NOT guarantee response time which may be very long.

jinchao

在 2013年4月16日星期二UTC+8下午9时06分44秒,Jordan Zimmerman写道:
Reply all
Reply to author
Forward
0 new messages