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;
}
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);
}
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));
}
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;
}
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);
}
Aggregations