On Sat, Sep 14, 2013 at 1:00 PM, Emmanuel Lécharny <elecharny@gmail.com> wrote:
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();

shouldn't this be returning a BTree<V,V>? cause we don't support an array as a holder of
multiple values

    /**
     * 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




--
Kiran Ayyagari
http://keydap.com