You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Ohad Ben Porat <oh...@outbrain.com> on 2009/12/23 09:29:51 UTC
Fetching sequential children
Hey,
Under the main node of my application I have the following sequential children: mytest1, mytest2, mytest3, sometest1,sometest2,sometest3.
Now, I want to get all children of my main node that starts with mytest, something like getChildren("/main/mytest*", false), is there a command for that? Or must I bring all children and filter out the unwanted ones?
Ohad
Re: Fetching sequential children
Posted by Steve Chu <st...@gmail.com>.
You may create the parent node first: /main/mytest
Then create sequential children under it:
create_sequential('/main/mytest/mytest')
...
/main/mytest/mytest0000000001
/main/mytest/mytest0000000002
/main/mytest/mytest0000000003
..
So you could get all sequential children by get_children('/main/mytest')
On Wed, Dec 23, 2009 at 4:29 PM, Ohad Ben Porat <oh...@outbrain.com> wrote:
> Hey,
>
> Under the main node of my application I have the following sequential children: mytest1, mytest2, mytest3, sometest1,sometest2,sometest3.
> Now, I want to get all children of my main node that starts with mytest, something like getChildren("/main/mytest*", false), is there a command for that? Or must I bring all children and filter out the unwanted ones?
>
> Ohad
>
--
Best Regards,
Steve Chu
http://stvchu.org
Re: Fetching sequential children
Posted by Mahadev Konar <ma...@yahoo-inc.com>.
Hi ohad,
there isnt a way to get a selected set of children from the servers. So
you will have to get all of them and filter out the unwanted ones. Also,
what Steve suggested in the other email might be useful for you.
Thanks
mahadev
On 12/23/09 12:29 AM, "Ohad Ben Porat" <oh...@outbrain.com> wrote:
> Hey,
>
> Under the main node of my application I have the following sequential
> children: mytest1, mytest2, mytest3, sometest1,sometest2,sometest3.
> Now, I want to get all children of my main node that starts with mytest,
> something like getChildren("/main/mytest*", false), is there a command for
> that? Or must I bring all children and filter out the unwanted ones?
>
> Ohad