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