directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <elecha...@gmail.com>
Subject [Mavibot] Value storage
Date Sat, 14 Sep 2013 07:30:45 GMT
Hi guys,

sorry for having been mute those last days, many side things to deal with.

We had a big performance issue in mavibot when we store many elements in
the btree, as we had to deserialize all the leaf's values when we update
a leaf, which is really a bad idea. I was working on a fix for this, but
I hit a wall : how do we manage the keys associated with more than one
value ?

Kiran has added a mechnism by which a sub-btree can be used to solve
this case. This is fine, except that it does not work well with the new
Holder hierarchy I'm using, so I'm now working on storing the values in
a slight different way. Basically, all the values -either single ot
multipke - will be stored into a encapsulating data structure. The
ElementHolder.getValue() will return this encapsulatng objects, instead
of the direct value.

Here is the proposed interface :

public interface Value<V>
{
    /**
     * Tells if the value is single or contains a set of values
     * @return True if we have one single value
     */
    boolean isSingleValue();


    /**
     * @return The stored value, or the first value if we have more than one
     */
    V getValue();


    /**
     * @return The array of stored values.
     */
    V[] getValues();


    /**
     * Add a new value
     * @param value The added value
     */
    void addValue( V value );


    /**
     * Delete a given value
     * @param value The value to delete
     */
    void deleteValue( V value );


    /**
     * Remove all the values
     */
    void clear();
}


The hierarchy will be :

(Value)
   o
   |
   +-- [[AbstractValue]]
           ^       ^
           |       |
           |       +-- [SingleValue]
           +---------- [BTreeValue]

This is a first round, I have to come with more details later.

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com 


Mime
View raw message