use of org.ow2.proactive.resourcemanager.nodesource.NodeSourceDescriptor in project scheduling by ow2-proactive.
the class RMCore method createNodeSourcePolicyActivity.
private NodeSourcePolicy createNodeSourcePolicyActivity(NodeSourceDescriptor nodeSourceDescriptor, NodeSource nodeSourceToDeploy) {
NodeSourcePolicy nodeSourcePolicyStub = NodeSourcePolicyFactory.activate(nodeSourceToDeploy.getPolicy(), nodeSourceDescriptor.getPolicyParameters());
nodeSourceToDeploy.setActivePolicy(nodeSourcePolicyStub);
return nodeSourcePolicyStub;
}
use of org.ow2.proactive.resourcemanager.nodesource.NodeSourceDescriptor 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);
}
use of org.ow2.proactive.resourcemanager.nodesource.NodeSourceDescriptor in project scheduling by ow2-proactive.
the class RMCore method defineNodeSource.
/**
* {@inheritDoc}
*/
@Override
public BooleanWrapper defineNodeSource(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams, boolean nodesRecoverable) {
this.validateNodeSourceNameOrFail(nodeSourceName);
nodeSourceName = nodeSourceName.trim();
logger.info("Define node source " + nodeSourceName + REQUESTED_BY_STRING + this.caller.getName());
NodeSourceDescriptor nodeSourceDescriptor = this.persistNodeSourceAndGetDescriptor(nodeSourceName, infrastructureType, infraParams, policyType, policyParams, nodesRecoverable);
NodeSource nodeSource = this.createNodeSourceInstance(nodeSourceDescriptor);
this.definedNodeSources.put(nodeSourceName, nodeSource);
this.monitoring.nodeSourceEvent(new RMNodeSourceEvent(RMEventType.NODESOURCE_DEFINED, this.caller.getName(), nodeSourceName, nodeSource.getDescription(), nodeSourceDescriptor.getProvider().getName(), nodeSource.getStatus().toString()));
logger.info(NODE_SOURCE_STRING + nodeSourceName + " has been successfully defined");
return new BooleanWrapper(true);
}
use of org.ow2.proactive.resourcemanager.nodesource.NodeSourceDescriptor 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;
}
Aggregations