directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Ayyagari <kayyag...@apache.org>
Subject Re: [Mavibot] Value storage
Date Mon, 16 Sep 2013 09:41:16 GMT
On Mon, Sep 16, 2013 at 3:00 PM, Emmanuel Lécharny <elecharny@gmail.com>wrote:

> Le 9/14/13 9:45 AM, Kiran Ayyagari a écrit :
> > On Sat, Sep 14, 2013 at 1:00 PM, Emmanuel Lécharny <elecharny@gmail.com
> >wrote:
> >
> >> Hi guys,
> >>
> >>
> >>     /**
> >>      * @return The array of stored values.
> >>      */
> >>     V[] getValues();
> >>
> >> shouldn't this be returning a BTree<V,V>? cause we don't support an
> array
> > as a holder of
> > multiple values
>
> The fact that it's stored as a BTree is implementation dependent, I'm
> not sure the user of the API should know about it. What the user wants
> is to get back the stored values, and this is convenient to get back an
> array.
>
> IMO, it is not convenient, we cannot copy all the values into an array
and return, and returning an iterator is not going to help either, both will
severely affect the search performance
If needed, we can wrap it an immutable structure and return the BTree
to prevent direct updates, but I wish to differ this until we see the impact
on partition implementation.

> Now, it's probably even better to make the Value class being an
> Iterable, exactly like the Attribute class. To get all the values, it's
> just a mater to iterate on the Value.
>
>
> Btw, for clarity, I'll rename the classes and interfaces to Element (and
> SingleElement, BtreeElement, etc).
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>


-- 
Kiran Ayyagari
http://keydap.com

Mime
View raw message