Rice Pastry API

rice.rm.testing
Class RMRegrTestApp

java.lang.Object
  |
  +--rice.pastry.client.PastryAppl
        |
        +--rice.pastry.client.CommonAPIAppl
              |
              +--rice.rm.testing.RMRegrTestApp
All Implemented Interfaces:
MessageReceiver, RMClient
Direct Known Subclasses:
DirectRMRegrTestApp, DistRMRegrTestApp

public abstract class RMRegrTestApp
extends CommonAPIAppl
implements RMClient

Version:
$Id: RMRegrTestApp.java,v 1.9 2003/07/23 21:17:58 animesh Exp $
Author:
Animesh Nandi

Nested Class Summary
static class RMRegrTestApp.ReplicateEntry
           
 
Field Summary
 rice.pastry.routing.SendOptions _sendOptions
           
 int m_appCount
           
 rice.pastry.IdSet m_keys
           
protected  rice.pastry.PastryNode m_pastryNode
           
 java.util.Hashtable m_pendingObjects
           
 rice.pastry.IdSet m_refreshedKeys
           
 rice.rm.RMImpl m_rm
           
static int rFactor
           
 
Fields inherited from class rice.pastry.client.PastryAppl
address, instance, thePastryNode
 
Constructor Summary
RMRegrTestApp(rice.pastry.PastryNode pn, rice.pastry.security.Credentials cred, java.lang.String instance)
          Constructor
 
Method Summary
 boolean checkPassed()
           
 void clearRefreshedKeys()
           
 void deliver(rice.pastry.Id key, rice.pastry.messaging.Message msg)
          Called by pastry when a message arrives for this application.
 void fetch(rice.pastry.IdSet keySet)
          This upcall is invoked to notify the application that is should fetch the cooresponding keys in this set, since the node is now responsible for these keys also.
 rice.pastry.security.Credentials getCredentials()
          Returns the credentials of this application.
 rice.pastry.NodeHandle getLocalHandle()
           
 rice.pastry.PastryNode getPastryNode()
           
 RMRegrTestApp.ReplicateEntry getPendingObject(rice.pastry.Id key)
           
 void heartbeat(rice.pastry.Id objectKey)
           
 void isResponsible(rice.pastry.IdRange range)
          This upcall is to notify the application of the range of keys for which it is responsible.
 void periodicMaintenance()
           
 void printRange()
           
 void refresh(rice.pastry.Id objectKey)
           
 void remove(rice.pastry.Id objectKey)
           
 void removePendingObject(rice.pastry.Id key)
           
 boolean replicate(rice.pastry.Id objectKey)
          Called by the application when it needs to replicate an object into k nodes closest to the object key.
 void replicateSuccess(rice.pastry.Id key, boolean status)
           
 void rmIsReady(rice.rm.RM rm)
          This upcall is simply to denote that the underlying replica manager (rm) is ready.
 rice.pastry.IdSet scan(rice.pastry.IdRange range)
          This upcall should return the set of keys that the application currently stores in this range.
 void store(rice.pastry.Id key, java.lang.Object object)
           
 
Methods inherited from class rice.pastry.client.CommonAPIAppl
forward, leafSetChange, localLookup, messageForAppl, neighborSet, notifyReady, range, range, receiveMessage, replicaSet, route, update
 
Methods inherited from class rice.pastry.client.PastryAppl
enrouteMessage, getAddress, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, registerReceiver, routeMsg, routeMsgDirect, routeSetChange, sendMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_pastryNode

protected rice.pastry.PastryNode m_pastryNode

_sendOptions

public rice.pastry.routing.SendOptions _sendOptions

m_rm

public rice.rm.RMImpl m_rm

m_appCount

public int m_appCount

m_keys

public rice.pastry.IdSet m_keys

m_refreshedKeys

public rice.pastry.IdSet m_refreshedKeys

rFactor

public static int rFactor

m_pendingObjects

public java.util.Hashtable m_pendingObjects
Constructor Detail

RMRegrTestApp

public RMRegrTestApp(rice.pastry.PastryNode pn,
                     rice.pastry.security.Credentials cred,
                     java.lang.String instance)
Constructor

Parameters:
cred - The credentials
Method Detail

rmIsReady

public void rmIsReady(rice.rm.RM rm)
Description copied from interface: RMClient
This upcall is simply to denote that the underlying replica manager (rm) is ready. The 'rm' should henceforth be used by this RMClient to issue the downcalls on the RM interface.

Specified by:
rmIsReady in interface RMClient
Parameters:
rm - the instance of the Replica Manager

getPendingObject

public RMRegrTestApp.ReplicateEntry getPendingObject(rice.pastry.Id key)

removePendingObject

public void removePendingObject(rice.pastry.Id key)

printRange

public void printRange()

replicate

public boolean replicate(rice.pastry.Id objectKey)
Called by the application when it needs to replicate an object into k nodes closest to the object key.

Parameters:
objectKey - the pastry key for the object
Returns:
true if operation successful else false

replicateSuccess

public void replicateSuccess(rice.pastry.Id key,
                             boolean status)

remove

public void remove(rice.pastry.Id objectKey)

fetch

public void fetch(rice.pastry.IdSet keySet)
Description copied from interface: RMClient
This upcall is invoked to notify the application that is should fetch the cooresponding keys in this set, since the node is now responsible for these keys also.

Specified by:
fetch in interface RMClient
Parameters:
keySet - set containing the keys that needs to be fetched

store

public void store(rice.pastry.Id key,
                  java.lang.Object object)

scan

public rice.pastry.IdSet scan(rice.pastry.IdRange range)
Description copied from interface: RMClient
This upcall should return the set of keys that the application currently stores in this range. Should return a empty IdSet (not null), in the case that no keys belong to this range.

Specified by:
scan in interface RMClient
Parameters:
range - the requested range

isResponsible

public void isResponsible(rice.pastry.IdRange range)
Description copied from interface: RMClient
This upcall is to notify the application of the range of keys for which it is responsible. The application might choose to react to call by calling a scan(complement of this range) to the persistance manager and get the keys for which it is not responsible and call delete on the persistance manager for those objects.

Specified by:
isResponsible in interface RMClient
Parameters:
range - the range of keys for which the local node is currently responsible

getCredentials

public rice.pastry.security.Credentials getCredentials()
Description copied from class: CommonAPIAppl
Returns the credentials of this application.

Specified by:
getCredentials in class CommonAPIAppl
Returns:
the credentials.

deliver

public void deliver(rice.pastry.Id key,
                    rice.pastry.messaging.Message msg)
Description copied from class: CommonAPIAppl
Called by pastry when a message arrives for this application.

Specified by:
deliver in class CommonAPIAppl
Parameters:
msg - the message that is arriving.

getLocalHandle

public rice.pastry.NodeHandle getLocalHandle()

heartbeat

public void heartbeat(rice.pastry.Id objectKey)

refresh

public void refresh(rice.pastry.Id objectKey)

periodicMaintenance

public void periodicMaintenance()

checkPassed

public boolean checkPassed()

clearRefreshedKeys

public void clearRefreshedKeys()

getPastryNode

public rice.pastry.PastryNode getPastryNode()

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection