Search in sources :

Example 6 with NodeSourceDescriptor

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

Example 7 with NodeSourceDescriptor

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

Example 8 with 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);
}
Also used : NodeSource(org.ow2.proactive.resourcemanager.nodesource.NodeSource) RMNodeSourceEvent(org.ow2.proactive.resourcemanager.common.event.RMNodeSourceEvent) BooleanWrapper(org.objectweb.proactive.core.util.wrapper.BooleanWrapper) NodeSourceDescriptor(org.ow2.proactive.resourcemanager.nodesource.NodeSourceDescriptor)

Example 9 with NodeSourceDescriptor

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

Aggregations

NodeSource (org.ow2.proactive.resourcemanager.nodesource.NodeSource)4 NodeSourcePolicy (org.ow2.proactive.resourcemanager.nodesource.policy.NodeSourcePolicy)4 BooleanWrapper (org.objectweb.proactive.core.util.wrapper.BooleanWrapper)3 RMNodeSourceEvent (org.ow2.proactive.resourcemanager.common.event.RMNodeSourceEvent)2 NodeSourceData (org.ow2.proactive.resourcemanager.db.NodeSourceData)2 NodeSourceDescriptor (org.ow2.proactive.resourcemanager.nodesource.NodeSourceDescriptor)2 InfrastructureManager (org.ow2.proactive.resourcemanager.nodesource.infrastructure.InfrastructureManager)2 Serializable (java.io.Serializable)1 UniqueID (org.objectweb.proactive.core.UniqueID)1 Client (org.ow2.proactive.resourcemanager.authentication.Client)1 DefaultInfrastructureManager (org.ow2.proactive.resourcemanager.nodesource.infrastructure.DefaultInfrastructureManager)1