com.sun.sgs.impl.service.nodemap
Interface NodeAssignPolicy

All Known Implementing Classes:
AbstractNodePolicy, LocalNodePolicy, RoundRobinPolicy

public interface NodeAssignPolicy

Interface for node assignment. The actual policy to be used is configurable in the node mapping server. A class implementing the NodeAssignPolicy interface must have a public constructor that takes the following argument:


Field Summary
static long SERVER_NODE
          An id representing the server node.
 
Method Summary
 long chooseNode(long requestingNode)
          Choose a node to assign an identity, or set of identities to.
 long chooseNode(long requestingNode, Identity id)
          Choose a node to assign an identity to.
 void nodeAvailable(long nodeId)
          Inform the policy that a node is now available.
 void nodeUnavailable(long nodeId)
          Inform the policy that a node is no longer available.
 void reset()
          Reset the policy, informing it that no nodes are available.
 

Field Detail

SERVER_NODE

static final long SERVER_NODE
An id representing the server node.

See Also:
Constant Field Values
Method Detail

chooseNode

long chooseNode(long requestingNode)
                throws NoNodesAvailableException
Choose a node to assign an identity, or set of identities to.

Parameters:
requestingNode - the id of the node making the request, or SERVER_NODE if the system is making the request
Returns:
the chosen node's id
Throws:
NoNodesAvailableException - if there are no live nodes to assign to

chooseNode

long chooseNode(long requestingNode,
                Identity id)
                throws NoNodesAvailableException
Choose a node to assign an identity to.

Parameters:
requestingNode - the id of the node making the request, or SERVER_NODE if the system is making the request
id - the identity which needs an assignment.
Returns:
the chosen node's id
Throws:
NoNodesAvailableException - if there are no live nodes to assign to

nodeAvailable

void nodeAvailable(long nodeId)
Inform the policy that a node is now available.

Parameters:
nodeId - the node ID

nodeUnavailable

void nodeUnavailable(long nodeId)
Inform the policy that a node is no longer available.

Parameters:
nodeId - the node ID

reset

void reset()
Reset the policy, informing it that no nodes are available.


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