Search in sources :

Example 1 with NodeSourceStatus

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

the class RMCore method nodeSourceUnregister.

/**
 * Unregisters node source from the resource manager core.
 */
public BooleanWrapper nodeSourceUnregister(String nodeSourceName, NodeSourceStatus nodeSourceStatus, RMNodeSourceEvent evt) {
    NodeSource nodeSource = this.deployedNodeSources.remove(nodeSourceName);
    if (nodeSource == null) {
        logger.warn("Attempt to remove non-existing node source " + nodeSourceName);
        return new BooleanWrapper(false);
    }
    this.disconnectNodeSourceClient(nodeSourceName, nodeSource);
    logger.info(NODE_SOURCE_STRING + nodeSourceName + " has been successfully " + evt.getEventType().getDescription());
    this.monitoring.nodeSourceEvent(evt);
    this.emitRemovedEventIfNodeSourceWasNotUndeployed(nodeSource, nodeSourceStatus);
    if ((this.deployedNodeSources.isEmpty()) && this.toShutDown) {
        this.finalizeShutdown();
    }
    return new BooleanWrapper(true);
}
Also used : NodeSource(org.ow2.proactive.resourcemanager.nodesource.NodeSource) BooleanWrapper(org.objectweb.proactive.core.util.wrapper.BooleanWrapper)

Example 2 with NodeSourceStatus

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

the class RMCore method emitRemovedEventIfNodeSourceWasNotUndeployed.

private void emitRemovedEventIfNodeSourceWasNotUndeployed(NodeSource nodeSource, NodeSourceStatus nodeSourceStatus) {
    if (!nodeSourceStatus.equals(NodeSourceStatus.NODES_UNDEPLOYED)) {
        String nodeSourceAdministratorName = nodeSource.getAdministrator().getName();
        String nodeSourceName = nodeSource.getName();
        RMNodeSourceEvent removedEvent = new RMNodeSourceEvent(RMEventType.NODESOURCE_REMOVED, nodeSourceAdministratorName, nodeSourceName, nodeSource.getDescription(), nodeSourceAdministratorName, nodeSourceStatus.toString());
        logger.info(NODE_SOURCE_STRING + nodeSourceName + " has been successfully " + removedEvent.getEventType().getDescription());
        this.monitoring.nodeSourceEvent(removedEvent);
    }
}
Also used : RMNodeSourceEvent(org.ow2.proactive.resourcemanager.common.event.RMNodeSourceEvent)

Example 3 with NodeSourceStatus

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

the class RMCore method updateNodeSourceDescriptorWithStatusAndPersist.

private void updateNodeSourceDescriptorWithStatusAndPersist(NodeSourceDescriptor descriptor, NodeSourceStatus status) {
    descriptor.setStatus(status);
    NodeSourceData nodeSourceData = NodeSourceData.fromNodeSourceDescriptor(descriptor);
    this.dbManager.updateNodeSource(nodeSourceData);
}
Also used : NodeSourceData(org.ow2.proactive.resourcemanager.db.NodeSourceData)

Aggregations

BooleanWrapper (org.objectweb.proactive.core.util.wrapper.BooleanWrapper)1 RMNodeSourceEvent (org.ow2.proactive.resourcemanager.common.event.RMNodeSourceEvent)1 NodeSourceData (org.ow2.proactive.resourcemanager.db.NodeSourceData)1 NodeSource (org.ow2.proactive.resourcemanager.nodesource.NodeSource)1