Search in sources :

Example 1 with DeploymentNode

use of org.iobserve.analysis.data.graph.DeploymentNode in project iobserve-analysis by research-iobserve.

the class AdaptationCalculation method compareServers.

private void compareServers(final Set<DeploymentNode> servers) {
    for (final DeploymentNode reDeplServer : servers) {
        if (reDeplServer.getContainingComponents().size() == 0) {
            // If the server dosn't contain any components => IGNORE
            continue;
        }
        final DeploymentNode runServer = this.runtimeDeploymentNodes.get(reDeplServer.getResourceContainerID());
        if (runServer == null) {
            // It is an so far unused server!
            final AcquireAction action = ResourceContainerActionFactory.createAcquireAction(reDeplServer);
            this.rcActions.add(action);
        } else {
            // Server was and is still in use
            this.runtimeDeploymentNodes.remove(runServer.getResourceContainerID(), runServer);
        }
    }
    for (final DeploymentNode runServer : this.runtimeDeploymentNodes.values()) {
        // AssemblyContext does not exist anymore in redeployment model!
        final TerminateAction action = ResourceContainerActionFactory.createTerminateAction(runServer);
        this.rcActions.add(action);
    }
}
Also used : AcquireAction(org.iobserve.planning.systemadaptation.AcquireAction) TerminateAction(org.iobserve.planning.systemadaptation.TerminateAction) DeploymentNode(org.iobserve.analysis.data.graph.DeploymentNode)

Aggregations

DeploymentNode (org.iobserve.analysis.data.graph.DeploymentNode)1 AcquireAction (org.iobserve.planning.systemadaptation.AcquireAction)1 TerminateAction (org.iobserve.planning.systemadaptation.TerminateAction)1