directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selcuk AYA <>
Subject Re: Question about JDBM key/value replacement
Date Fri, 27 Apr 2012 12:09:55 GMT
On Thu, Apr 26, 2012 at 4:52 PM, Emmanuel L├ęcharny <> wrote:
> Hi guys,
> currently, we can replace an existing value when its associated key exists
> in the BTree. What I'd like to do is to replace both key and value in this
> case.
> The rational is that the key mau contain some extra information that are not
> used to find the key, like the nbChildren/nbDescendant for a ParentIdAndrdn
> key in the RdnIndex.
> Is there an easy way to do that with JDBM, or should we extend the API it
> offers ?

as I understand you are trying to store some auxiliary information per
key? With JDBM we can:
  - provide <K, aux> tuple as the key and pass the key comparator to
be the comparator for the actual keys.
  - change JDBM code to update key inside when replacing an entry.

however, in general, I do not think we can expect a key/value store to
update the key when replacing an entry. So I am not sure it is a good
idea to do this kind of thing.

> That would save us a lot of CPU, as we currently have to drop the key and
> values and reinject them, which is an costly operation...
> Ideas ?
> --
> Regards,
> Cordialement,
> Emmanuel L├ęcharny


View raw message