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

Switch to Threaded View
Zookeeper >> mail # dev >> Listing the znodes efficiently


Copy link to this message
-
Re: Listing the znodes efficiently
One pointer for this discussion is the HierarchicalLedgerManager in BookKeeper, org.apache.bookkeeper.meta.

-Flavio

On May 18, 2012, at 2:26 AM, Patrick Hunt wrote:

> On Thu, May 17, 2012 at 5:04 PM, Narayanan Arunachalam
> <[EMAIL PROTECTED]> wrote:
>> Another approach to improve the performance:
>> For example creating znode to represent something "/abc001"
>> Compute hash and index of the slot for the resource name using HashMap like hash() and indexFor() methods. So if the slot size is 10 this could result in a number between 0 and 9. Assume we get 4 for this path.
>> Create znode /4/abc001
>> So the nodes gets distributed like in a HashMap.
>> For listing:
>> Do a getChildren() on /0 and /1 and so on to bring back the desired results.
>
> Typically users who need this functionality implement it in client side code.
>
> Patrick
>
>> On May 17, 2012, at 3:31 PM, Patrick Hunt <[EMAIL PROTECTED]> wrote:
>>
>>> On Thu, May 17, 2012 at 1:55 PM, Narayanan A R
>>> <[EMAIL PROTECTED]> wrote:
>>>> Hi,
>>>>
>>>> Does ZK has or have plans to add the following features:
>>>>
>>>> - Query znodes under a path by passing filter on the attributes.
>>>
>>> Sounds intriguing, depending on the details. Might be a good addition
>>> to the multi* feature. (not discussed before afaik)
>>>
>>>> - Ability to paginate the znodes under a given path.
>>>
>>> Check jira/mailarchives - this has definitely been discussed in the
>>> past. (Henry iirc... aha, see here
>>> https://issues.apache.org/jira/browse/ZOOKEEPER-423 but search around,
>>> you'll likely find more)
>>>
>>>> Without this, the app has to pull all the nodes and perform the comparison
>>>> at the client end.
>>>
>>> Yes, that's true of what's available today.
>>>
>>> Patrick

flavio
junqueira
senior research scientist
 
[EMAIL PROTECTED]
direct +34 93-183-8828
 
avinguda diagonal 177, 8th floor, barcelona, 08018, es
phone (408) 349 3300    fax (408) 349 3301