[chord] How to get some blocks once

Emil Sit sit at MIT.EDU
Fri Mar 23 08:10:41 EST 2007


On Fri, 23 March 2007 at 11:04 (+0800), zkfzle wrote:
> I am tring to get several blocks which have the same staring of their ChordIDs.
> For example,I want to get the blocks in a peer:
> AAA112121212
> AAAdfdkfjkld
> AAAfdy8ikjkl
> All start with AAA;

This is an interesting question and not something we have support for.

Are you ultimately at the application layer interested in "I want
all the keys that start with AAA in the system", or is it actually
"I want all the keys that start with AAA on node X"?  Put more
concretely, is this something you want to use via a dhashclient object in an
application perhaps as part of a lookup?  Or do you want to actually
send RPCs to a particular node you discovered out of band (the way
nodeq works)?

> I found do_getblockrange() in the adbd.c. I tried to modify "filestore
> -f " in filestore.c.Could you please tell me what functions called
> do_getblockrange() and where the adb_getblockrangeres *res was sent?

adbd is used internally to support lsd's database needs---it is a
separate process that is logically part of lsd.  So, you can't really
call at adbd from outside (e.g., an arbitrary node elsewhere in
the network).  In any event, getblockrange was intended as a way
for lsd to enumerate specific keys that had (or did not have) a
certain replication level in order to generate repairs; it might
return objects that are not stored on the peer in question.  And, 
I just committed the other day some changes that stopped calling it
it from the dhblock_*_srvs.

The most likely thing you _could_ do is to call MERKLESYNC_GETKEYS.
Unfortunately, the switch in December over to maintd also moved
merklesync_program_1 support out of lsd and into maintd, which
makes calling it a little harder/different.  One option would be to
make a separate GETKEYS procedure in dhash_program_1.  Or we could
update nodeq to speak to maintd on its new port over TCP....  which
one is better may depend on your intended usage.

-- 
Emil Sit / MIT CSAIL PDOS / http://pdos.csail.mit.edu/chord/  



More information about the chord mailing list