com.ubermq.chord
Class AbstractChordInfrastructure

java.lang.Object
com.ubermq.chord.AbstractChordInfrastructure
- All Implemented Interfaces:
- ChordInfrastructure
- public abstract class AbstractChordInfrastructure
- extends java.lang.Object
- implements ChordInfrastructure
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
identifierFactory
protected final ChordIdentifierFactory identifierFactory
- The identifier factory that can be used to create
chord identifiers.
replication
private int replication
AbstractChordInfrastructure
protected AbstractChordInfrastructure(ChordIdentifierFactory f,
int replication)
- Creates an abstract chord infrastructure object, given
an identifier factory.
query
public java.lang.Object query(java.lang.Object key)
throws java.rmi.RemoteException
- Queries the infrastructure for the value associated with a key.
Since a query operation is computationally and network intensive,
it is assumed that nodes have some expectation that the given key
resides somewhere in the infrastructure.
- Specified by:
query in interface ChordInfrastructure
store
public void store(java.lang.Object key,
java.lang.Object value)
throws java.rmi.RemoteException
- Stores the given value at the specified key, somewhere in the
chord infrastructure. In the absence of concurrent modification,
it is true that:
given i.store(key, v), then
v == i.query(key);
By design, clients should not need to be aware of physically
where the information associated with the key is stored.
- Specified by:
store in interface ChordInfrastructure
findSuccessor
public ChordNode findSuccessor(ChordIdentifier id)
- Returns the node that follows the specified identifier
on the identifier circle. This node is known as the
successor, and is in charge of storing keys
for the given identifier.
- Specified by:
findSuccessor in interface ChordInfrastructure
findPredecessor
public ChordNode findPredecessor(ChordIdentifier id)
- Returns the node that precedes the specified identifier
on the identifier circle.
- Specified by:
findPredecessor in interface ChordInfrastructure