Search in sources :

Example 1 with InfrastructureManager

use of org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager in project scheduling by ow2-proactive.

the class NodesRecoveryManager method recoverFullyDeployedInfrastructureOrReset.

public boolean recoverFullyDeployedInfrastructureOrReset(String nodeSourceName, NodeSource nodeSourceToDeploy, NodeSourceDescriptor descriptor) {
    boolean recoverNodes = false;
    boolean existPersistedNodes = this.existPersistedNodes(nodeSourceName);
    if (existPersistedNodes) {
        InfrastructureManager im = InfrastructureManagerFactory.recover(descriptor);
        if (!im.getDeployingAndLostNodes().isEmpty()) {
            logRecoveryAbortedReason(nodeSourceName, "There were deploying or lost nodes");
            this.rmCore.getDbManager().removeAllNodesFromNodeSource(nodeSourceName);
        } else {
            recoverNodes = true;
            nodeSourceToDeploy.setInfrastructureManager(im);
        }
    } else {
        logRecoveryAbortedReason(nodeSourceName, "This node source has no associated nodes in database");
    }
    return recoverNodes;
}
Also used : InfrastructureManager(org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager)

Example 2 with InfrastructureManager

use of org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager in project scheduling by ow2-proactive.

the class NodeSourceTest method setUp.

@Before
public void setUp() {
    PAResourceManagerProperties.RM_TOPOLOGY_ENABLED.updateProperty("false");
    infrastructureManager = mock(InfrastructureManager.class);
    when(infrastructureManager.isUsingDeployingNode()).thenReturn(false);
    NodeSourcePolicy nodeSourcePolicy = mock(NodeSourcePolicy.class);
    when(nodeSourcePolicy.getProviderAccessType()).thenReturn(AccessType.ALL);
    client = new Client(Subjects.create("user"), false);
    nodeSource = createNodeSource(infrastructureManager, nodeSourcePolicy, client);
    RMCore.topologyManager = new TopologyManager(HostsPinger.class);
}
Also used : TopologyManager(org.ow2.proactive.resourcemanager.selection.topology.TopologyManager) HostsPinger(org.ow2.proactive.resourcemanager.frontend.topology.pinging.HostsPinger) InfrastructureManager(org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager) Client(org.ow2.proactive.resourcemanager.authentication.Client) NodeSourcePolicy(org.ow2.proactive.resourcemanager.nodesource.policy.NodeSourcePolicy) Before(org.junit.Before)

Example 3 with InfrastructureManager

use of org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager in project scheduling by ow2-proactive.

the class NodeSourceTest method testDetectedPingedDownNodeCallingInfrastructureManagerInternalRemoveNodeTrueFlag.

@Test
public void testDetectedPingedDownNodeCallingInfrastructureManagerInternalRemoveNodeTrueFlag() throws RMException, ClassNotFoundException {
    Node node = createNode(PROACTIVE_PROGRAMMING_NODE_URL);
    nodeSource.internalAddNode(node);
    nodeSource.detectedPingedDownNode(node.getNodeInformation().getName(), node.getNodeInformation().getURL());
    verify(infrastructureManager).internalNotifyDownNode(anyString(), anyString(), any(Node.class));
}
Also used : RMNode(org.ow2.proactive.resourcemanager.rmnode.RMNode) Node(org.objectweb.proactive.core.node.Node) Test(org.junit.Test)

Example 4 with InfrastructureManager

use of org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager in project scheduling by ow2-proactive.

the class NodesRecoveryManager method recoverFullyDeployedInfrastructureOrReset.

protected boolean recoverFullyDeployedInfrastructureOrReset(String nodeSourceName, NodeSource nodeSourceToDeploy, NodeSourceDescriptor descriptor) {
    boolean recoverNodes = false;
    boolean existPersistedNodes = this.existPersistedNodes(nodeSourceName);
    if (existPersistedNodes) {
        InfrastructureManager im = InfrastructureManagerFactory.recover(descriptor);
        if (!im.getDeployingAndLostNodes().isEmpty()) {
            // if there are deploying nodes, we will not recover
            this.rmCore.getDbManager().removeAllNodesFromNodeSource(nodeSourceName);
        } else {
            recoverNodes = true;
            nodeSourceToDeploy.setInfrastructureManager(im);
        }
    }
    return recoverNodes;
}
Also used : InfrastructureManager(org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager)

Example 5 with InfrastructureManager

use of org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager in project scheduling by ow2-proactive.

the class RMCore method createNodeSourceInstance.

private NodeSource createNodeSourceInstance(NodeSourceDescriptor nodeSourceDescriptor) {
    InfrastructureManager infrastructureManager = InfrastructureManagerFactory.create(nodeSourceDescriptor);
    NodeSourcePolicy notActivePolicy = NodeSourcePolicyFactory.create(nodeSourceDescriptor.getPolicyType());
    return new NodeSource(this.getUrl(), nodeSourceDescriptor.getName(), infrastructureManager, notActivePolicy, (RMCore) PAActiveObject.getStubOnThis(), this.monitoring, nodeSourceDescriptor);
}
Also used : NodeSource(org.ow2.proactive.resourcemanager.nodesource.NodeSource) DefaultInfrastructureManager(org.ow2.proactive.resourcemanager.nodesource.infrastructure.DefaultInfrastructureManager) InfrastructureManager(org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager) NodeSourcePolicy(org.ow2.proactive.resourcemanager.nodesource.policy.NodeSourcePolicy)

Aggregations

InfrastructureManager (org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager)4 NodeSourcePolicy (org.ow2.proactive.resourcemanager.nodesource.policy.NodeSourcePolicy)2 Before (org.junit.Before)1 Test (org.junit.Test)1 Node (org.objectweb.proactive.core.node.Node)1 Client (org.ow2.proactive.resourcemanager.authentication.Client)1 RMNodeEvent (org.ow2.proactive.resourcemanager.common.event.RMNodeEvent)1 RMCore (org.ow2.proactive.resourcemanager.core.RMCore)1 NodeSourceData (org.ow2.proactive.resourcemanager.db.NodeSourceData)1 RMException (org.ow2.proactive.resourcemanager.exception.RMException)1 RMMonitoringImpl (org.ow2.proactive.resourcemanager.frontend.RMMonitoringImpl)1 HostsPinger (org.ow2.proactive.resourcemanager.frontend.topology.pinging.HostsPinger)1 NodeSource (org.ow2.proactive.resourcemanager.nodesource.NodeSource)1 DefaultInfrastructureManager (org.ow2.proactive.resourcemanager.nodesource.infrastructure.DefaultInfrastructureManager)1 RMDeployingNode (org.ow2.proactive.resourcemanager.rmnode.RMDeployingNode)1 RMNode (org.ow2.proactive.resourcemanager.rmnode.RMNode)1 TopologyManager (org.ow2.proactive.resourcemanager.selection.topology.TopologyManager)1