Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ubermq.chord
Class AbstractChordInfrastructure  view AbstractChordInfrastructure download AbstractChordInfrastructure.java

java.lang.Object
  extended bycom.ubermq.chord.AbstractChordInfrastructure
All Implemented Interfaces:
ChordInfrastructure

public abstract class AbstractChordInfrastructure
extends java.lang.Object
implements ChordInfrastructure


Field Summary
protected  ChordIdentifierFactory identifierFactory
          The identifier factory that can be used to create chord identifiers.
private  int replication
           
 
Constructor Summary
protected AbstractChordInfrastructure(ChordIdentifierFactory f, int replication)
          Creates an abstract chord infrastructure object, given an identifier factory.
 
Method Summary
 ChordNode findPredecessor(ChordIdentifier id)
          Returns the node that precedes the specified identifier on the identifier circle.
 ChordNode findSuccessor(ChordIdentifier id)
          Returns the node that follows the specified identifier on the identifier circle.
 java.lang.Object query(java.lang.Object key)
          Queries the infrastructure for the value associated with a key.
 void store(java.lang.Object key, java.lang.Object value)
          Stores the given value at the specified key, somewhere in the chord infrastructure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ubermq.chord.ChordInfrastructure
close, entryPoint, getEntryPointURI
 

Field Detail

identifierFactory

protected final ChordIdentifierFactory identifierFactory
The identifier factory that can be used to create chord identifiers.


replication

private int replication
Constructor Detail

AbstractChordInfrastructure

protected AbstractChordInfrastructure(ChordIdentifierFactory f,
                                      int replication)
Creates an abstract chord infrastructure object, given an identifier factory.

Method Detail

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