org.kth.dks
Interface DKSDHTInterface

All Superinterfaces:
DKSInterface
All Known Subinterfaces:
DKSDHTVisualizationInterface, DKSMCastDHTInterface
All Known Implementing Classes:
DKSDHTImpl, DKSMCastDHTImpl

public interface DKSDHTInterface
extends DKSInterface

An important concept used by this interface is that the value bound to a key using the DKS DHT should be treated as an array of DKSObject, and that it shall be possible to modify this array atomically. The DKSObject structure consists of arbitrary contents represented by a java.lang.Object, along with an integer content identifier. Two DKSObject are considered equal if they have equal content identifiers. Keys are represented by long (64 bit) integers in this interface. It is up to other services using this interface to translate application specific keys to this representation.


Method Summary
 void addToBinding(long key, DKSObject value)
          Value is added to the list of bindings associated with key.
 void broadcast(DKSObject message)
          Broadcast a message to all nodes
 void changeBinding(long key, DKSObject oldValue, DKSObject newValue)
          All ocurrences of oldValue in the bindings associated with key are replaced by newValue.
 DKSObject[] lookupBinding(long key)
          Returns a vector of DKSObjects associated with key in the DHT
 DKSObject[] lookupBinding(long minKey, long maxKey)
          Returns a list of all bindings associated with keys greater than or equal to minKey, and less than or equal to maxKey.
 void removeFromBinding(long key, DKSObject value)
          Value is removed from the list of bindings associated with key.
 
Methods inherited from interface org.kth.dks.DKSInterface
addMsgHandler, broadcastRestricted, create, findResponsible, getDKSRef, getDKSURL, join, leave, logLevel, route, routeAsync, routeAsyncFrom, send, unregisterNode
 

Method Detail

addToBinding

void addToBinding(long key,
                  DKSObject value)
Value is added to the list of bindings associated with key.


removeFromBinding

void removeFromBinding(long key,
                       DKSObject value)
Value is removed from the list of bindings associated with key. Any ocurrence of value in the list is determined by comparison of the DKSObject content identifier.


changeBinding

void changeBinding(long key,
                   DKSObject oldValue,
                   DKSObject newValue)
All ocurrences of oldValue in the bindings associated with key are replaced by newValue. Any ocurrence of value in the list is determined by comparison of the DKSObject content identifier.


lookupBinding

DKSObject[] lookupBinding(long key)
Returns a vector of DKSObjects associated with key in the DHT

Parameters:
key - long specifying the key to be looked up
Returns:
DKSObject[] with values associated to key

lookupBinding

DKSObject[] lookupBinding(long minKey,
                          long maxKey)
Returns a list of all bindings associated with keys greater than or equal to minKey, and less than or equal to maxKey.


broadcast

void broadcast(DKSObject message)
Broadcast a message to all nodes

Specified by:
broadcast in interface DKSInterface


Copyright © 2010. All Rights Reserved.