com.sun.sgs.impl.service.nodemap.affinity
Class LPADriver

java.lang.Object
  extended by com.sun.sgs.impl.service.nodemap.affinity.BasicState
      extended by com.sun.sgs.impl.service.nodemap.affinity.LPADriver
All Implemented Interfaces:
AffinityGroupFinder

public class LPADriver
extends BasicState
implements AffinityGroupFinder

A driver for the Label Propagation Algorithm affinity group finders. The driver is responsible for instantiating the affinity group system, managing its life cycle, and invoking the group finder as necessary.

A driver must be instantiated on each node of the Darkstar cluster.

The following properties are supported:

Property: com.sun.sgs.impl.service.nodemap.affinity.graphbuilder.class
Default: com.sun.sgs.impl.service.nodemap.affinity.graph.dlpa.WeightedGraphBuilder
The graph builder to use. Set to None if no affinity group finding is required, which is useful for testing.

Property: com.sun.sgs.impl.service.nodemap.affinity.update.period
Default: 60 (one minute)}
The frequency that we find affinity groups, in seconds. The value must be between 5 and 65535.


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_UPDATE_FREQ
          The default value of the update frequency, in seconds.
static String GRAPH_CLASS_NONE
          The value to be given to GRAPH_CLASS_PROPERTY if no affinity group finding should be instantiated (useful for testing).
static String GRAPH_CLASS_PROPERTY
          The property for specifying the graph builder class.
static String UPDATE_FREQ_PROPERTY
          The property name for the update frequency.
 
Fields inherited from class com.sun.sgs.impl.service.nodemap.affinity.BasicState
state
 
Constructor Summary
LPADriver(Properties properties, ComponentRegistry systemRegistry, TransactionProxy txnProxy)
          Constructs an instance of this class with the specified properties.
 
Method Summary
 void disable()
          Disables the finder.
 void enable()
          Enables the finder.
 AffinityGraphBuilder getGraphBuilder()
          Returns the graph builder used by this driver, or null if we are not building graphs.
 GraphListener getGraphListener()
          Returns the graph listener used by this driver, or null if we are not building graphs.
 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

GRAPH_CLASS_PROPERTY

public static final String GRAPH_CLASS_PROPERTY
The property for specifying the graph builder class.

See Also:
Constant Field Values

UPDATE_FREQ_PROPERTY

public static final String UPDATE_FREQ_PROPERTY
The property name for the update frequency.

See Also:
Constant Field Values

DEFAULT_UPDATE_FREQ

static final int DEFAULT_UPDATE_FREQ
The default value of the update frequency, in seconds.

See Also:
Constant Field Values

GRAPH_CLASS_NONE

public static final String GRAPH_CLASS_NONE
The value to be given to GRAPH_CLASS_PROPERTY if no affinity group finding should be instantiated (useful for testing).

See Also:
Constant Field Values
Constructor Detail

LPADriver

public LPADriver(Properties properties,
                 ComponentRegistry systemRegistry,
                 TransactionProxy txnProxy)
          throws Exception
Constructs an instance of this class with the specified properties.

Parameters:
properties - the properties for configuring this subsystem
systemRegistry - the registry of available system components
txnProxy - the transaction proxy
Throws:
Exception - if an error occurs during creation
Method Detail

disable

public void disable()
Disables the finder.

Specified by:
disable in interface AffinityGroupFinder

enable

public void enable()
Enables the finder.

Specified by:
enable in interface AffinityGroupFinder

shutdown

public void shutdown()
Shuts down the finder.

Specified by:
shutdown in interface AffinityGroupFinder

getGraphBuilder

public AffinityGraphBuilder getGraphBuilder()
Returns the graph builder used by this driver, or null if we are not building graphs.

Returns:
the graph builder or null if there is none

getGraphListener

public GraphListener getGraphListener()
Returns the graph listener used by this driver, or null if we are not building graphs.

Returns:
the graph listener or null if there is none

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