|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.service.nodemap.affinity.BasicState
com.sun.sgs.impl.service.nodemap.affinity.dlpa.LabelPropagationServer
public class LabelPropagationServer
The server portion of the distributed label propagation algorithm.
The server is known to each node participating in the algorithm. It is responsible for preparing the nodes for a run of the algorithm, coordinating the iterations of the algorithm, and collecting and merging results from each node when finished.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sun.sgs.impl.service.nodemap.affinity.BasicState |
|---|
BasicState.State |
| Field Summary | |
|---|---|
(package private) static int |
DEFAULT_MAX_IO_ATTEMPTS
The default number of IO task retries. |
(package private) static int |
DEFAULT_RETRY_WAIT_TIME
The default time interval to wait between IO task retries. |
static int |
DEFAULT_SERVER_PORT
The default value of the server port. |
static String |
IO_TASK_PROPERTY_PREFIX
Prefix for io task related properties. |
static String |
IO_TASK_RETRIES_PROPERTY
An optional property that specifies the maximum number of retries for IO tasks in services. |
static String |
IO_TASK_WAIT_TIME_PROPERTY
An optional property that specifies the wait time between successive IO task retries. |
static String |
SERVER_EXPORT_NAME
The name we export ourselves under. |
static String |
SERVER_PORT_PROPERTY
The property name for the server port. |
| Fields inherited from class com.sun.sgs.impl.service.nodemap.affinity.BasicState |
|---|
state |
| Constructor Summary | |
|---|---|
LabelPropagationServer(ProfileCollector col,
WatchdogService wdog,
Properties properties)
Constructs a new label propagation server. |
|
| Method Summary | |
|---|---|
void |
disable()
Disables the finder. |
void |
enable()
Enables the finder. |
NavigableSet<RelocatingAffinityGroup> |
findAffinityGroups()
Finds affinity groups across all nodes in the Darkstar cluster. |
void |
finishedIteration(long nodeId,
boolean converged,
boolean failed,
int iteration)
Indicates that the given nodeId has completed an iteration
of the label propagation algorithm. |
LPAClient |
getLPAClientProxy(long nodeId)
Returns the LPAClient for the given nodeId. |
void |
readyToBegin(long nodeId,
boolean failed)
Indicates that the given nodeId is ready to begin the label
propagation algorithm. |
void |
register(long nodeId,
LPAClient client)
Registers a proxy for the node. |
(package private) static boolean |
runIoTask(IoRunnable ioTask,
WatchdogService wdog,
long nodeId,
int maxTries,
int waitTime,
String name)
Executes the specified ioTask by invoking its run method. |
void |
shutdown()
Shuts down the finder. |
| Methods inherited from class com.sun.sgs.impl.service.nodemap.affinity.BasicState |
|---|
checkForDisabledOrShutdownState, checkForShutdownState, setDisabledState, setEnabledState, setShutdownState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SERVER_PORT_PROPERTY
public static final int DEFAULT_SERVER_PORT
public static final String SERVER_EXPORT_NAME
public static final String IO_TASK_PROPERTY_PREFIX
public static final String IO_TASK_RETRIES_PROPERTY
public static final String IO_TASK_WAIT_TIME_PROPERTY
static final int DEFAULT_MAX_IO_ATTEMPTS
static final int DEFAULT_RETRY_WAIT_TIME
| Constructor Detail |
|---|
public LabelPropagationServer(ProfileCollector col,
WatchdogService wdog,
Properties properties)
throws IOException
col - the profile collectorwdog - the watchdog service, used for error reportingproperties - the application properties
IOException - if an error occurs| Method Detail |
|---|
public NavigableSet<RelocatingAffinityGroup> findAffinityGroups()
throws AffinityGroupFinderFailedException
AffinityGroupFinderFailedException
is thrown. Errors include nodes not responding to server requests.
findAffinityGroups in interface LPAAffinityGroupFinderAffinityGroupFinderFailedException - if there is an errorpublic void disable()
disable in interface AffinityGroupFinderpublic void enable()
enable in interface AffinityGroupFinderpublic void shutdown()
shutdown in interface AffinityGroupFinder
public void readyToBegin(long nodeId,
boolean failed)
throws IOException
nodeId is ready to begin the label
propagation algorithm.
readyToBegin in interface LPAServernodeId - the node that is ready to beginfailed - true if there was a problem while setting up
IOException - if there is a communication problem
public void finishedIteration(long nodeId,
boolean converged,
boolean failed,
int iteration)
throws IOException
nodeId has completed an iteration
of the label propagation algorithm.
finishedIteration in interface LPAServernodeId - the node that has finished an iterationconverged - true if the node believes the algorithm has
converged and can be stoppedfailed - true if there was a problem while runningiteration - the iteration that has finished
IOException - if there is a communication problem
public LPAClient getLPAClientProxy(long nodeId)
throws IOException
LPAClient for the given nodeId.
If null is returned, the node should be considered failed.
getLPAClientProxy in interface LPAServernodeId - the node we need the proxy for
null
if the node has failed
IOException - if there is a communication problem
public void register(long nodeId,
LPAClient client)
throws IOException
register in interface LPAServernodeId - the node the proxy representsclient - the client proxy, which this server and other nodes
can call
IOException - if there is a communication problem
static boolean runIoTask(IoRunnable ioTask,
WatchdogService wdog,
long nodeId,
int maxTries,
int waitTime,
String name)
ioTask by invoking its run method. If the specified task throws an
IOException, this method will retry the task for a fixed
number of times. The number of retries and the wait time between
retries are configurable properties.
This is much the same as the like method in AbstractService, except we don't bother to check for a transactional context (we won't be in one).
ioTask - a task with IO-related operationswdog - the watchdog service for the local node, in case of failurenodeId - the node that should be shut down in case of failuremaxTries - the number of times to attempt the retrywaitTime - the amount of time to wait before retryname - name of caller, in case of failure
true if the ioTask ran successfully
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||