Search in sources :

Example 1 with RMState

use of org.ow2.proactive.resourcemanager.common.RMState in project scheduling by ow2-proactive.

the class SchedulingMethodImpl method getFreeResources.

private Set<String> getFreeResources(Policy currentPolicy) {
    RMState rmState = getRMProxiesManager().getRmProxy().getState();
    currentPolicy.setRMState(rmState);
    Set<String> freeResources = rmState.getFreeNodes();
    if (logger.isDebugEnabled()) {
        logger.debug("eligible nodes : " + (freeResources.size() < 5 ? freeResources : freeResources.size()));
    }
    return freeResources;
}
Also used : RMState(org.ow2.proactive.resourcemanager.common.RMState)

Example 2 with RMState

use of org.ow2.proactive.resourcemanager.common.RMState in project scheduling by ow2-proactive.

the class SessionSharingTest method sessions_are_shared_rm_login.

@Test
public void sessions_are_shared_rm_login() throws Exception {
    String sessionId = rmRest.rmConnect("login", "pw");
    assertTrue(studioRest.getWorkflows(sessionId).isEmpty());
    when(schedulerMock.freeze()).thenReturn(true);
    boolean frozen = schedulerRest.freezeScheduler(sessionId);
    assertTrue(frozen);
    when(rmMock.getState()).thenReturn(new RMState(new RMStateNodeUrls(new HashSet<String>(), new HashSet<String>(), new HashSet<String>()), Long.valueOf(-1)));
    RMState rmState = rmRest.getState(sessionId);
    assertNotNull(rmState);
    rmRest.rmDisconnect(sessionId);
    try {
        rmRest.getState(sessionId);
        fail();
    } catch (NotConnectedException expected) {
    // expected
    }
    try {
        schedulerRest.freezeScheduler(sessionId);
        fail();
    } catch (NotConnectedRestException expected) {
    // expected
    }
}
Also used : NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) NotConnectedRestException(org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException) RMState(org.ow2.proactive.resourcemanager.common.RMState) RMStateNodeUrls(org.ow2.proactive.resourcemanager.common.RMStateNodeUrls) Test(org.junit.Test)

Example 3 with RMState

use of org.ow2.proactive.resourcemanager.common.RMState in project scheduling by ow2-proactive.

the class LocalInfrastructureLifecycleTest method checkResourceManagerState.

private void checkResourceManagerState(int expectedNumberOfNodes) {
    RMState s = this.resourceManager.getState();
    assertEquals(expectedNumberOfNodes, s.getTotalNodesNumber());
    assertEquals(expectedNumberOfNodes, s.getFreeNodesNumber());
}
Also used : RMState(org.ow2.proactive.resourcemanager.common.RMState)

Example 4 with RMState

use of org.ow2.proactive.resourcemanager.common.RMState in project scheduling by ow2-proactive.

the class SSHInfrastructureV2LifecycleTest method checkResourceManagerState.

private void checkResourceManagerState(int expectedNumberOfNodes) {
    RMState s = this.resourceManager.getState();
    assertEquals(expectedNumberOfNodes, s.getTotalNodesNumber());
    assertEquals(expectedNumberOfNodes, s.getFreeNodesNumber());
}
Also used : RMState(org.ow2.proactive.resourcemanager.common.RMState)

Example 5 with RMState

use of org.ow2.proactive.resourcemanager.common.RMState in project scheduling by ow2-proactive.

the class TestLocalInfrastructureRestartDownNodesPolicy method testRestartDownNodesPolicyWithNullParams.

@Test
public void testRestartDownNodesPolicyWithNullParams() throws Exception {
    RMTHelper.log("Test 0 - create down nodes policy with null parameters (null is a valid input)");
    nodeSourceName = "Node_source_0";
    createNodeSourceWithNodes(nodeSourceName, null);
    RMState stateTest0 = resourceManager.getState();
    assertEquals(defaultDescriptorNodesNb, stateTest0.getTotalNodesNumber());
    assertEquals(defaultDescriptorNodesNb, stateTest0.getFreeNodesNumber());
}
Also used : RMState(org.ow2.proactive.resourcemanager.common.RMState) Test(org.junit.Test) RMFunctionalTest(functionaltests.utils.RMFunctionalTest)

Aggregations

RMState (org.ow2.proactive.resourcemanager.common.RMState)14 Test (org.junit.Test)9 RMFunctionalTest (functionaltests.utils.RMFunctionalTest)6 Node (org.objectweb.proactive.core.node.Node)4 NodeSet (org.ow2.proactive.utils.NodeSet)4 RMStateNodeUrls (org.ow2.proactive.resourcemanager.common.RMStateNodeUrls)3 RMNodeEvent (org.ow2.proactive.resourcemanager.common.event.RMNodeEvent)3 Criteria (org.ow2.proactive.utils.Criteria)3 ResourceManager (org.ow2.proactive.resourcemanager.frontend.ResourceManager)2 SSHInfrastructureV2 (org.ow2.proactive.resourcemanager.nodesource.infrastructure.SSHInfrastructureV2)2 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)2 NotConnectedRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException)2 RMMonitorsHandler (functionaltests.monitor.RMMonitorsHandler)1 RestartDownNodesPolicy (org.ow2.proactive.resourcemanager.nodesource.policy.RestartDownNodesPolicy)1 StaticPolicy (org.ow2.proactive.resourcemanager.nodesource.policy.StaticPolicy)1