Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper, mail # user - Re: need for more conditional write support


Copy link to this message
-
Re: need for more conditional write support
Dave Wright 2010-12-16, 16:16
My recommendation would actually be a combination of the two which
offers the most flexibility:

zoo_multi_test_and_set(List<string> znodesToTest, List<int> versions,
List<string> znodesToSet, List<byte[]> data)

...this specifies a list of nodes & versions to check, and if the
versions match, a list of nodes to set and the associated data.
This allows multiple scenarios, including setting nodes other than the
ones you are version checking, setting more nodes than you version
check, checking more nodes than you set, etc.
I don't think the implementation would be any harder than either of the others.

-Dave
On Wed, Dec 15, 2010 at 10:50 AM, Ted Dunning <[EMAIL PROTECTED]> wrote:
> Well, I would just call the first method set.
>
> And I think that the second method is no easier to implement and probably a
> bit less useful.
>
> The idea that the second might be almost as useful as the first is
> interesting however.  It probably
> means that we should allow some of the data elements to be null or something
> to allow for testing
> versions but not setting data.
>
> On Tue, Dec 14, 2010 at 11:21 PM, Qian Ye <[EMAIL PROTECTED]> wrote:
>
>> zoo_multi_test_and_set(List<int> versions, List<string> znodes,
>> List<byte[]> data)
>>
>> can solve the problem I mentioned before, and some relavant issues, like
>> hard for programmers to use, as mentioned in mail-archive, should be paid
>> attention to. I think we can move small step first, that is, provide
>> interface like
>>
>> zoo_multi_test_and_set(List<int> versions, List<string> znodes, byte[]
>> data, string znode)
>>
>>
>> The API test versions of several different znodes before set one znode, and
>> if the client want to set other znode, it can call this API repeatedly.
>> Because we only set one node by this API, the result will be straight,
>> success or failure. We need not take care of the half-success result.
>>
>> How do ur guys think about this API?
>>
>
+
Ted Dunning 2010-12-16, 18:01
+
Dave Wright 2010-12-16, 18:06
+
Jared Cantwell 2010-12-16, 18:39
+
Henry Robinson 2010-12-16, 19:04
+
Ted Dunning 2010-12-16, 19:21
+
Ted Dunning 2010-12-16, 19:22
+
Ted Dunning 2010-12-16, 19:23
+
Ted Dunning 2010-12-16, 19:25
+
Qian Ye 2010-12-21, 02:56
+
Ted Dunning 2010-12-21, 03:22
+
Benjamin Reed 2010-12-21, 05:24
+
Benjamin Reed 2010-12-21, 05:24
+
Ted Dunning 2010-12-21, 06:08
+
Benjamin Reed 2010-12-21, 06:57
+
Jared Cantwell 2010-12-21, 21:16
+
Henry Robinson 2010-12-21, 21:30
+
Ted Dunning 2010-12-21, 21:48
+
Jared Cantwell 2010-12-22, 01:44
+
Ted Dunning 2010-12-22, 02:06
+
Henry Robinson 2010-12-22, 09:00
+
Ted Dunning 2010-12-22, 18:29