Search in sources :

Example 11 with ResourceCreationRequest

use of es.bsc.compss.types.ResourceCreationRequest in project compss by bsc-wdc.

the class CloudManager method getCurrentState.

public String getCurrentState(String prefix) {
    StringBuilder sb = new StringBuilder();
    // Current state
    sb.append(prefix).append("CLOUD = [").append("\n");
    sb.append(prefix).append("\t").append("CURRENT_STATE = [").append("\n");
    for (CloudProvider cp : providers.values()) {
        sb.append(cp.getCurrentState(prefix + "\t" + "\t"));
    }
    sb.append(prefix).append("\t").append("]").append("\n");
    // Pending requests
    sb.append(prefix).append("\t").append("PENDING_REQUESTS = [").append("\n");
    for (CloudProvider cp : providers.values()) {
        for (ResourceCreationRequest rcr : cp.getPendingRequests()) {
            Map<CloudInstanceTypeDescription, int[]> composition = rcr.getRequested().getTypeComposition();
            // REQUEST ARE COMPOSED OF A SINGLE INSTANCE TYPE
            for (CloudInstanceTypeDescription citd : composition.keySet()) {
                sb.append(prefix).append("\t").append("\t").append("REQUEST = ").append(citd.getName()).append("\n");
            }
        }
    }
    sb.append(prefix).append("\t").append("]").append("\n");
    sb.append(prefix).append("]");
    return sb.toString();
}
Also used : ResourceCreationRequest(es.bsc.compss.types.ResourceCreationRequest) CloudProvider(es.bsc.compss.types.CloudProvider) CloudInstanceTypeDescription(es.bsc.compss.types.resources.description.CloudInstanceTypeDescription)

Aggregations

ResourceCreationRequest (es.bsc.compss.types.ResourceCreationRequest)11 CloudMethodResourceDescription (es.bsc.compss.types.resources.description.CloudMethodResourceDescription)8 CloudProvider (es.bsc.compss.types.CloudProvider)6 ExtendedCloudMethodWorker (es.bsc.compss.types.ExtendedCloudMethodWorker)4 FakeNode (es.bsc.compss.types.fake.FakeNode)4 CloudInstanceTypeDescription (es.bsc.compss.types.resources.description.CloudInstanceTypeDescription)4 Test (org.junit.Test)4 Implementation (es.bsc.compss.types.implementations.Implementation)2 MethodResourceDescription (es.bsc.compss.types.resources.MethodResourceDescription)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ConnectorException (es.bsc.compss.connectors.ConnectorException)1 InitNodeException (es.bsc.compss.exceptions.InitNodeException)1 NoResourceAvailableException (es.bsc.compss.exceptions.NoResourceAvailableException)1 MOProfile (es.bsc.compss.scheduler.multiobjective.types.MOProfile)1 MethodImplementation (es.bsc.compss.types.implementations.MethodImplementation)1 ProjectFileValidationException (es.bsc.compss.types.project.exceptions.ProjectFileValidationException)1 CloudImageDescription (es.bsc.compss.types.resources.description.CloudImageDescription)1 ResourcesFileValidationException (es.bsc.compss.types.resources.exceptions.ResourcesFileValidationException)1 LinkedList (java.util.LinkedList)1