public abstract class HostsFileBasedInfrastructureManager extends InfrastructureManager
Modifier and Type | Class and Description |
---|---|
protected class |
HostsFileBasedInfrastructureManager.NodeNameBuilder
Utility class to encapsulate node name building and node name parsing.
|
InfrastructureManager.PersistedInfraVariablesHandler<T>, InfrastructureManager.RMDeployingNodeAccessor
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_NODE_DEPLOYMENT_FAILURE_THRESHOLD |
protected static int |
DEFAULT_NODE_TIMEOUT |
protected static long |
DEFAULT_WAIT_TIME_BETWEEN_NODE_DEPLOYMENT_FAILURES |
protected File |
hostsList |
protected static org.apache.log4j.Logger |
logger |
protected int |
maxDeploymentFailure |
protected HostsFileBasedInfrastructureManager.NodeNameBuilder |
nodeNameBuilder |
protected int |
nodeTimeOut |
protected long |
waitBetweenDeploymentFailures |
ELASTIC, nodeSource, persistedInfraVariables, readLock, RM_URL_KEY, writeLock
Constructor and Description |
---|
HostsFileBasedInfrastructureManager() |
Modifier and Type | Method and Description |
---|---|
void |
acquireAllNodes()
Check if any host is available and acquire the nodes of available hosts
|
void |
acquireNode()
Acquire the nodes of available hosts
|
protected void |
addTimeouts(List<String> nodesUrl) |
protected boolean |
anyTimedOut(List<String> nodesUrl) |
protected void |
configure(Object... parameters)
Configures the infrastructure.
|
Map<Integer,String> |
getSectionDescriptions() |
protected void |
initializePersistedInfraVariables()
This method should initialize a value in the runtime variables map for all the runtime variables that will be
used in the class.
|
protected abstract void |
killNodeImpl(org.objectweb.proactive.core.node.Node node,
InetAddress host)
Kills the node passed as parameter
|
protected void |
notifyAcquiredNode(org.objectweb.proactive.core.node.Node node)
Parent IM notifies about a new node registration
|
protected void |
notifyDeployingNodeLost(String pnURL)
This method is called by Infrastructure Manager in case of a deploying node removal.
|
void |
notifyDownNode(String nodeName,
String nodeUrl,
org.objectweb.proactive.core.node.Node node)
Define what needs to be done in an infrastructure implementation when a node is detected as down.
|
void |
onDownNodeReconnection(org.objectweb.proactive.core.node.Node node)
Called by the system every time a node that is DOWN reconnects
and changes its status to FREE or BUSY.
|
protected void |
readHosts(File f)
Internal host file parser
|
void |
removeNode(org.objectweb.proactive.core.node.Node node)
Removes the node from the resource manager.
|
protected void |
removeTimeouts(List<String> nodesUrl) |
protected abstract void |
startNodeImpl(HostTracker hostTracker,
int nbNodes,
List<String> depNodeURLs)
Launch the node on the host passed as parameter
|
protected void |
startNodeImplWithRetries(HostTracker hostTracker,
int nbNodes,
int retries) |
String |
toString() |
acquireAllNodes, acquireNodes, acquireNodes, addDeployingNode, addDeployingNodeWithLockAndPersist, addLostNodeWithLockAndPersist, addMultipleDeployingNodes, buildDeployingNodeURL, checkAllNodesAreAcquiredAndDo, checkNodeIsAcquiredAndDo, declareDeployingNodeLost, getDefaultCommandLineBuilder, getDeployingAndLostNodes, getDeployingNodesWithLock, getDeployingOrLostNode, getDescription, getEmptyCommandLineBuilder, getLostNodesWithLock, getMeta, getPersistedDeployingNodesUrl, getPersistedInfraVariable, getPersistedLostNodesUrl, getRmUrl, internalConfigure, internalNotifyDownNode, internalRegisterAcquiredNode, internalRemoveDeployingNode, internalRemoveNode, internalShutDown, isShutDown, isUsingDeployingNode, multipleDeclareDeployingNodeLost, persistInfrastructureVariables, reconfigure, recoverPersistedInfraVariables, removeDownNodePriorToNotify, searchForNotAcquiredRmNode, setNodeSource, setPersistedInfraVariable, setPersistedNodeSourceData, setRmDbManager, setRmUrl, shutDown, update, updateDeployingNodeDescription
protected static final org.apache.log4j.Logger logger
protected static final int DEFAULT_NODE_TIMEOUT
protected static final int DEFAULT_NODE_DEPLOYMENT_FAILURE_THRESHOLD
protected static final long DEFAULT_WAIT_TIME_BETWEEN_NODE_DEPLOYMENT_FAILURES
protected File hostsList
protected int nodeTimeOut
protected int maxDeploymentFailure
protected long waitBetweenDeploymentFailures
protected HostsFileBasedInfrastructureManager.NodeNameBuilder nodeNameBuilder
public Map<Integer,String> getSectionDescriptions()
getSectionDescriptions
in interface NodeSourcePlugin
getSectionDescriptions
in class InfrastructureManager
protected void initializePersistedInfraVariables()
InfrastructureManager
InfrastructureManager.configure(Object...)
method.
This method runs with the write lock acquired.initializePersistedInfraVariables
in class InfrastructureManager
protected void configure(Object... parameters)
configure
in class InfrastructureManager
parameters
- of the infrastructure managerprotected void readHosts(File f) throws IOException
File format: one host per line, optionally followed by a space and an integer describing the maximum number of runtimes (1 if not specified). Example:
example.com example.org 5 example.net 3
f
- the file from which hosts names are to be extractedIOException
- parsing failedpublic void acquireAllNodes()
acquireAllNodes
in class InfrastructureManager
public void acquireNode()
acquireNode
in class InfrastructureManager
protected void notifyDeployingNodeLost(String pnURL)
notifyDeployingNodeLost
in class InfrastructureManager
pnURL
- the deploying node's URL for which one the timeout occurred.protected void notifyAcquiredNode(org.objectweb.proactive.core.node.Node node) throws RMException
notifyAcquiredNode
in class InfrastructureManager
node
- the newly registered nodeRMException
- if the implementation does not approve the node acquisition
requestpublic void removeNode(org.objectweb.proactive.core.node.Node node)
removeNode
in class InfrastructureManager
node
- the node to release.public void notifyDownNode(String nodeName, String nodeUrl, org.objectweb.proactive.core.node.Node node)
notifyDownNode
in class InfrastructureManager
node
- the ProActive Programming Node that is down.public void onDownNodeReconnection(org.objectweb.proactive.core.node.Node node)
InfrastructureManager
onDownNodeReconnection
in class InfrastructureManager
node
- the node that has reconnected.protected void startNodeImplWithRetries(HostTracker hostTracker, int nbNodes, int retries) throws RMException
RMException
protected abstract void startNodeImpl(HostTracker hostTracker, int nbNodes, List<String> depNodeURLs) throws RMException
hostTracker
- The host on which one the node will be startednbNodes
- number of nodes to deploydepNodeURLs
- list of deploying or lost nodes urls createdRMException
- If the node hasn't been started. Very important to take care of that
in implementations to keep the infrastructure in a coherent state.protected abstract void killNodeImpl(org.objectweb.proactive.core.node.Node node, InetAddress host) throws RMException
node
- The node to killhost
- The host of the nodeRMException
- if a problem occurred while removing