You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2007/05/31 13:36:07 UTC

[Mitosis] Distinction between leaves and branches

Hi,

I was just starting to work again on MMR, and I reached a point where
we may need to implement some lock mechanism to protect us against
concurrent access.

Let's assume these locks will be set on entries, then we will have to
know which kind of entry is the entry we want to lock. We can think of
2different kinds:
- leaves : an entry without any other entry father in the tree
- "branches" :an entry which is also the starting point for a sub tree
(nothing to do with subtrees, so the space between sub an tree)

In the first case, we can safely lock the entry
In the second case, we may have to be cautious to avoid locking the
full tree just because a telephoneNumber for this entry has been
changed ...

It would then be interesting to store a kind of virtual attribute
which hold the number of descendant within each entry. If this number
is 0, then this is a leaf.

This attribute will be created when the entry is read from the
backend, as we have the number of element at a point of the tree in
the HierarchicalIndex.

Well, this is just some "under the shower" thought I wanted to share.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: [Mitosis] Distinction between leaves and branches

Posted by Emmanuel Lecharny <el...@apache.org>.
Stefan Seelmann a écrit :

>Hi Emmanuel,
>
>Emmanuel Lecharny schrieb:
>  
>
>>It would then be interesting to store a kind of virtual attribute
>>which hold the number of descendant within each entry. If this number
>>is 0, then this is a leaf.
>>    
>>
>
>Just for info, there are already some (non-standardized) attributes for
>such information.
>
>hasSubordinates: Contains TRUE or FALSE. Defined in X.501. Implemented
>by OpenLDAP and IBM Tivoli.
>  
>
Oh! Very instersting Stefan! Thanks for the pointer.

>numSubordinates: Contains the number of direct subordinates, 0 means
>leaf. There is only an outdated internet draft
>http://www.faqs.org/ftp/internet-drafts/draft-boreham-numsubordinates-01.txt
>Implemented by Sun Directory and IBM Tivoli.
>
>subordinateCount: Novell eDirectory propriety attribute, works like
>numSubordinates.
>
>The Studio browser uses this information to decide if a branch is
>expandable or not.
>
>Or should this attribute contain the number of *all* subordinates
>(recursively) of an entry?
>  
>
Well, we have discussed it with pam and Alex lately, and we have some 
kind of ideas. But the info you pushed here are really interesting : we 
can even use the same attributes to have a kind of compatibility with 
existing servers.

Something new on our plate ...

Thanks again !
Emmanuel

PS : it might deserve a JIRA

Re: [Mitosis] Distinction between leaves and branches

Posted by Stefan Seelmann <se...@apache.org>.
Hi Emmanuel,

Emmanuel Lecharny schrieb:
> 
> It would then be interesting to store a kind of virtual attribute
> which hold the number of descendant within each entry. If this number
> is 0, then this is a leaf.

Just for info, there are already some (non-standardized) attributes for
such information.

hasSubordinates: Contains TRUE or FALSE. Defined in X.501. Implemented
by OpenLDAP and IBM Tivoli.

numSubordinates: Contains the number of direct subordinates, 0 means
leaf. There is only an outdated internet draft
http://www.faqs.org/ftp/internet-drafts/draft-boreham-numsubordinates-01.txt
Implemented by Sun Directory and IBM Tivoli.

subordinateCount: Novell eDirectory propriety attribute, works like
numSubordinates.

The Studio browser uses this information to decide if a branch is
expandable or not.

Or should this attribute contain the number of *all* subordinates
(recursively) of an entry?

Regards,
StefanS