You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Kiran Ayyagari <ay...@gmail.com> on 2008/05/30 23:00:20 UTC

interface changes in Table and MasterTable

hi All,

     Below is the summary which lead to the modification of put() and 
remove()/delete() method signatures in
     Table and MasterTable.

Changed Interfaces :- The put() and remove() methods in Table and put() 
and delete() methods in MasterTable.

The context :- Implementation of a Berkeley DB JE based partition for ADS.

Reason for the change :-  In the Jdbm based Table implementation put() 
and remove() operations return a value
                                           cause JDBM returns the 
existing/previous values (like a HashMap) for put and remove
                                           and these values are returned 
from the above mentioned operations.

                                           But JE doesn't return these 
(existing/previous) values instead returns a special Enum
                                           value stating the success or 
failure of the operation.

However I have observed that the return values of the existing put() and 
remove() methods are not used anywhere  hence I made the above said 
change ( tested this by changing the interfaces and the respective 
implementations and ran all tests ( Note: no functional aspects of the 
implementations was touched except removing or replacing the *return* 
statements) )

thoughts?

P.S :- In the JE based implementation we can still return the 
previous/existing value but this requires a
         lookup in each operation (put and remove) for storing the old 
value but this is not  a desirable 
         implementation.


Kiran Ayyagari

Re: interface changes in Table and MasterTable

Posted by Alex Karasulu <ak...@apache.org>.
On Fri, May 30, 2008 at 5:00 PM, Kiran Ayyagari <ay...@gmail.com>
wrote:

> hi All,
>
>    Below is the summary which lead to the modification of put() and
> remove()/delete() method signatures in
>    Table and MasterTable.
>
> Changed Interfaces :- The put() and remove() methods in Table and put() and
> delete() methods in MasterTable.
>
> The context :- Implementation of a Berkeley DB JE based partition for ADS.
>
> Reason for the change :-  In the Jdbm based Table implementation put() and
> remove() operations return a value
>                                          cause JDBM returns the
> existing/previous values (like a HashMap) for put and remove
>                                          and these values are returned from
> the above mentioned operations.
>
>                                          But JE doesn't return these
> (existing/previous) values instead returns a special Enum
>                                          value stating the success or
> failure of the operation.
>
> However I have observed that the return values of the existing put() and
> remove() methods are not used anywhere  hence I made the above said change (
> tested this by changing the interfaces and the respective implementations
> and ran all tests ( Note: no functional aspects of the implementations was
> touched except removing or replacing the *return* statements) )
>
> thoughts?
>

This sounds good - we certainly don't want to bother with the overhead of an
additional lookup.


> P.S :- In the JE based implementation we can still return the
> previous/existing value but this requires a
>        lookup in each operation (put and remove) for storing the old value
> but this is not  a desirable        implementation.
>

Thanks,
Alex