com.sun.sgs.impl.service.nodemap.affinity.dlpa
Interface LPAClient

All Superinterfaces:
Remote
All Known Implementing Classes:
LabelPropagation

public interface LPAClient
extends Remote

The label propagation algorithm clients, which can be called by the LPAServer to coordinate runs of the algorithm.


Method Summary
 void disable()
          Indicates that the affinity group finding system is disabled, so no new data should be collected (old can be disgarded).
 void enable()
          Indicates that the affinity group finding system is enabled, so new data should be collected again.
 Set<AffinityGroup> getAffinityGroups(long runNumber, boolean done)
          Returns the affinity groups found on this node.
 Map<Object,Map<Integer,List<Long>>> getRemoteLabels(Collection<Object> objIds)
          Get the labels for all vertices in our affinity graph for identities that have used the given objects.
 void notifyCrossNodeEdges(Collection<Object> objIds, long nodeId)
          Indicates that the given node probably contains edges to the graph on the local node.
 void prepareAlgorithm(long runNumber)
          A new run of the algorithm is about to start, so the client nodes should do whatever is necessary to set up for that run.
 void shutdown()
          Indicates that the affinity group finding system is shutting down, and all local resources should be cleaned up.
 void startIteration(int iteration)
          Start an iteration of the algorithm.
 

Method Detail

prepareAlgorithm

void prepareAlgorithm(long runNumber)
                      throws IOException
A new run of the algorithm is about to start, so the client nodes should do whatever is necessary to set up for that run. When prepared, LPAServer.readyToBegin(long, boolean) should be called. Called by the LPAServer.

Parameters:
runNumber - the number of this algorithm run
Throws:
IOException - if there is a communication problem

startIteration

void startIteration(int iteration)
                    throws IOException
Start an iteration of the algorithm. When finished, LPAServer.finishedIteration(long, boolean, boolean, int) should be called. Called by the LPAServer.

Parameters:
iteration - the iteration number
Throws:
IOException - if there is a communication problem

getAffinityGroups

Set<AffinityGroup> getAffinityGroups(long runNumber,
                                     boolean done)
                                     throws IOException
Returns the affinity groups found on this node. An empty set is returned if there are no affinity groups on this node. Called by the LPAServer. The LPAServer must call this with done set to true if it intends to start another algorithm run at any time in the future, even if the current run fails.

Parameters:
runNumber - the run number provided to the last prepareAlgorithm(long) call
done - true if all iterations are done, allowing cleanup
Returns:
the affinity groups on this node
Throws:
IllegalArgumentException - if runNumber does not match the last call to prepareAlgorithm
IOException - if there is a communication problem

notifyCrossNodeEdges

void notifyCrossNodeEdges(Collection<Object> objIds,
                          long nodeId)
                          throws IOException
Indicates that the given node probably contains edges to the graph on the local node. This informs the local node where non-local neighbors might reside. If there are no endpoints for the edges on this node, nothing is done. Called by other LPAClients.

Parameters:
objIds - the collection of objects, representing edges, that probably have endpoints to vertices on this node
nodeId - the node with vertices attached to the edges
Throws:
IOException - if there is a communication problem

getRemoteLabels

Map<Object,Map<Integer,List<Long>>> getRemoteLabels(Collection<Object> objIds)
                                                    throws IOException
Get the labels for all vertices in our affinity graph for identities that have used the given objects. If no such vertices exist, nothing is done and an empty map is returned. Called by other LPAClients.

Parameters:
objIds - the collection of objects, representing potential graph edges, that we want neighbor node information for
Returns:
a map of Objects (one for each element of objIds) to neighbor labels, with a count of each use
Throws:
IOException - if there is a communication problem

shutdown

void shutdown()
              throws IOException
Indicates that the affinity group finding system is shutting down, and all local resources should be cleaned up.

Throws:
IOException - if there is a communication problem

disable

void disable()
             throws IOException
Indicates that the affinity group finding system is disabled, so no new data should be collected (old can be disgarded).

Throws:
IOException - if there is a communication problem

enable

void enable()
            throws IOException
Indicates that the affinity group finding system is enabled, so new data should be collected again.

Throws:
IOException - if there is a communication problem

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved