Search in sources :

Example 21 with RMNodeData

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;
}
Also used : RMNode(org.ow2.proactive.resourcemanager.rmnode.RMNode)

Example 22 with RMNodeData

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;
}
Also used : RMNode(org.ow2.proactive.resourcemanager.rmnode.RMNode)

Aggregations

RMNodeData (org.ow2.proactive.resourcemanager.db.RMNodeData)18 Test (org.junit.Test)12 RMNode (org.ow2.proactive.resourcemanager.rmnode.RMNode)4 HashMap (java.util.HashMap)2 NodeSourceData (org.ow2.proactive.resourcemanager.db.NodeSourceData)2 Node (org.objectweb.proactive.core.node.Node)1 NodeState (org.ow2.proactive.resourcemanager.common.NodeState)1 AbstractRMNode (org.ow2.proactive.resourcemanager.rmnode.AbstractRMNode)1 RMNodeImpl (org.ow2.proactive.resourcemanager.rmnode.RMNodeImpl)1