[p2p-hackers] Multiple value per key query/response syntax?
Sean C. Rhea
srhea at cs.berkeley.edu
Wed May 18 23:30:31 UTC 2005
On May 17, 2005, at 11:53 AM, Kerry L. Bonin wrote:
> I'm looking for any good discussions or examples of reasonably robust
> request/response formats for multiple transaction multimap queries in
> general, and multiple-value per key DHT in particular.
> I was considering using expiration timestamp windowing in the query as
> a sort of crude iterator filter for values that expire at a constant
> interval after storage or refresh, but I'm wondering about variable
> TTL vs. variable refresh intervals, vs. classic remote iterator
> design.
In OpenDHT, we allow multiple values per key. If two puts come in with
the same key, we store them both; a get returns all values. If all
values don't fit in a single packet, we return only a packet's worth,
along with a "placemark" that can be used to retrieve the next set.
This placemark works just like an iterator.
The way this is implemented is that we return values for gets in the
order of their SHA-1 hashes. The placemark returned is just the SHA of
the last value returned. To get the next set, we just skip over all
values whose SHA is less than or equal to the placemark in the get
handling code.
If a put occurs during iteration, it just falls somewhere in this
sequence, and may or may not be returned to the client. If the client
starts a new get with placemark 0, however, it will be returned.
I hope that made sense,
Sean
--
To announce that there must be no criticism of the president or that
we
are to stand by the president right or wrong is not only unpatriotic
and
servile but is morally treasonable to the American public.
-- Theodore Roosevelt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://zgp.org/pipermail/p2p-hackers/attachments/20050518/1fff95c8/PGP.pgp
More information about the P2p-hackers
mailing list