ePOST API

rice.post.delivery
Class DeliveryPastImpl

java.lang.Object
  extended by rice.p2p.past.PastImpl
      extended by rice.p2p.past.gc.GCPastImpl
          extended by rice.post.delivery.DeliveryPastImpl
All Implemented Interfaces:
Application, GCPast, Past, ReplicationManagerClient, DeliveryPast

public class DeliveryPastImpl
extends GCPastImpl
implements DeliveryPast

Version:
$Id: DeliveryPastImpl.java 2808 2005-11-22 14:38:49Z jeffh $
Author:
Alan Mislove

Nested Class Summary
 
Nested classes/interfaces inherited from class rice.p2p.past.gc.GCPastImpl
GCPastImpl.ReplicaMap
 
Nested classes/interfaces inherited from class rice.p2p.past.PastImpl
PastImpl.MessageBuilder
 
Field Summary
protected  PastImpl delivered
           
protected  IdFactory factory
           
protected  int redundancy
           
 
Fields inherited from class rice.p2p.past.gc.GCPastImpl
collected, DEFAULT_EXPIRATION, realFactory, refreshed
 
Fields inherited from class rice.p2p.past.PastImpl
backup, endpoint, environment, fetchHandles, inserts, instance, logger, lookups, MESSAGE_TIMEOUT, other, policy, replicaManager, replicationFactor, storage, SUCCESSFUL_INSERT_THRESHOLD, trash
 
Fields inherited from interface rice.p2p.past.gc.GCPast
INFINITY_EXPIRATION
 
Constructor Summary
DeliveryPastImpl(Node node, StorageManager manager, Cache backup, int replicas, int redundancy, java.lang.String instance, PastImpl delivered, long collectionInterval)
          Constructor for DeliveryPastImpl
 
Method Summary
 void fetch(Id id, NodeHandle hint, Continuation command)
          This upcall is invoked to tell the client to fetch the given id, and to call the given command with the boolean result once the fetch is completed.
 void getGroups(Continuation command)
          Returns the list of PostEntityaddress for which we are the primary replica responsible for delivering messages.
 void getMessage(PostEntityAddress address, Continuation command)
          Returns the first message which is still pending to the given address.
protected  void setMetadata(Id id, Continuation command)
          Either returns the userid associated with the given id by looking in the cache, or reads it off of disk.
 void synchronize(Continuation command)
          Method which periodically checks to see if we've got receipts for any outstanding messages.
 
Methods inherited from class rice.p2p.past.gc.GCPastImpl
collect, deliver, exists, existsInOverlay, forward, insert, insert, refresh, refresh, refresh, reInsert, remove, scan, scan
 
Methods inherited from class rice.p2p.past.PastImpl
buildReplicationManager, cache, doInsert, fetch, getEndpoint, getEnvironment, getHandles, getInstance, getLocalNodeHandle, getOutstandingMessages, getReplication, getReplicationFactor, getResponseContinuation, getStorageManager, getUID, lookup, lookup, lookupHandle, lookupHandles, sendRequest, sendRequest, sendRequest, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface rice.p2p.past.gc.GCPast
insert, insert, refresh, refresh
 
Methods inherited from interface rice.p2p.past.Past
fetch, getEnvironment, getInstance, getLocalNodeHandle, getReplicationFactor, lookup, lookup, lookupHandle, lookupHandles
 

Field Detail

redundancy

protected int redundancy

delivered

protected PastImpl delivered

factory

protected IdFactory factory
Constructor Detail

DeliveryPastImpl

public DeliveryPastImpl(Node node,
                        StorageManager manager,
                        Cache backup,
                        int replicas,
                        int redundancy,
                        java.lang.String instance,
                        PastImpl delivered,
                        long collectionInterval)
Constructor for DeliveryPastImpl

Parameters:
node - The node below this Past implementation
manager - The storage manager to be used by Past
replicas - The number of object replicas
instance - The unique instance name of this Past
Method Detail

fetch

public void fetch(Id id,
                  NodeHandle hint,
                  Continuation command)
This upcall is invoked to tell the client to fetch the given id, and to call the given command with the boolean result once the fetch is completed. The client *MUST* call the command at some point in the future, as the manager waits for the command to return before continuing.

Specified by:
fetch in interface ReplicationManagerClient
Overrides:
fetch in class GCPastImpl
Parameters:
id - The id to fetch
hint - A hint where to find the key from. This is where the local node heard about the key.
command - The command to return the result to

synchronize

public void synchronize(Continuation command)
Method which periodically checks to see if we've got receipts for any outstanding messages. If so, then we remove the outstanding message from our pending list.

Specified by:
synchronize in interface DeliveryPast

getGroups

public void getGroups(Continuation command)
Returns the list of PostEntityaddress for which we are the primary replica responsible for delivering messages.

Specified by:
getGroups in interface DeliveryPast
Parameters:
command - The command to return the results to

getMessage

public void getMessage(PostEntityAddress address,
                       Continuation command)
Returns the first message which is still pending to the given address. If no such message exists, null is returned

Specified by:
getMessage in interface DeliveryPast
Parameters:
address - The address for the message
command - The command to return the results to

setMetadata

protected void setMetadata(Id id,
                           Continuation command)
Either returns the userid associated with the given id by looking in the cache, or reads it off of disk.

Parameters:
id - The id to return the PostEntityAddress of
command - The command to return the result to

ePOST API

Copyright © 2001-2005 - Rice Pastry.