use of org.ow2.proactive.resourcemanager.db.RMNodeData in project scheduling by ow2-proactive.
the class NodesRecoveryManager method recoverNodeInternally.
private RMNode recoverNodeInternally(NodeSource nodeSource, RMNodeData rmNodeData, String nodeUrl, Node node) {
RMNode rmNode = null;
// information to the node data retrieved in database.
if (rmNodeData.equalsToNode(node)) {
logger.info("Node to recover could successfully be looked up at URL: " + nodeUrl);
rmNode = nodeSource.internalAddNodeAfterRecovery(node, rmNodeData);
this.rmCore.registerAvailableNode(rmNode);
} else {
logger.error("The node that has been looked up does not have the same information as the node to recover: " + node.getNodeInformation().getName() + " is not equal to " + rmNodeData.getName() + " or " + node.getNodeInformation().getURL() + " is not equal to " + rmNodeData.getNodeUrl());
}
return rmNode;
}
use of org.ow2.proactive.resourcemanager.db.RMNodeData in project scheduling by ow2-proactive.
the class NodesRecoveryManager method recoverRMNode.
private RMNode recoverRMNode(NodeSource nodeSource, Map<NodeState, Integer> nodeStates, RMNodeData rmNodeData, String nodeUrl, Node node) {
RMNode rmnode = null;
if (node != null) {
rmnode = this.recoverNodeInternally(nodeSource, rmNodeData, nodeUrl, node);
this.nodesLockRestorationManager.handle(rmnode, rmNodeData.getProvider());
this.updateRecoveredNodeStateCounter(nodeStates, rmnode.getState());
} else {
// the node is not recoverable and does not appear in any data
// structures: we can remove it safely from database
this.rmCore.getDbManager().removeNode(rmNodeData, rmNodeData.getNodeSource().getName());
this.markNodesNotInDeployingStateAsDown(nodeSource, rmNodeData, nodeUrl);
this.updateRecoveredNodeStateCounter(nodeStates, NodeState.DOWN);
}
return rmnode;
}
Aggregations