Search in sources :

Example 6 with ParameterServerManager

use of com.tencent.angel.master.ps.ParameterServerManager in project angel by Tencent.

the class PSManagerTest method testPSManager.

@Test
public void testPSManager() throws Exception {
    try {
        LOG.info("===========================testPSManager===============================");
        AngelApplicationMaster angelAppMaster = LocalClusterContext.get().getMaster().getAppMaster();
        assertTrue(angelAppMaster != null);
        ParameterServerManager psManager = angelAppMaster.getAppContext().getParameterServerManager();
        Map<ParameterServerId, AMParameterServer> psMap = psManager.getParameterServerMap();
        assertEquals(psMap.size(), 1);
        AMParameterServer ps = psMap.get(psId);
        assertTrue(ps != null);
        assertEquals(ps.getId(), psId);
        assertEquals(ps.getState(), AMParameterServerState.RUNNING);
        Map<PSAttemptId, PSAttempt> psAttempts = ps.getPSAttempts();
        assertEquals(psAttempts.size(), 1);
        PSAttempt psAttempt = psAttempts.get(psAttempt0Id);
        assertEquals(psAttempt.getInternalState(), PSAttemptStateInternal.RUNNING);
    } catch (Exception x) {
        LOG.error("run testPSManager failed ", x);
        throw x;
    }
}
Also used : AMParameterServer(com.tencent.angel.master.ps.ps.AMParameterServer) PSAttemptId(com.tencent.angel.ps.PSAttemptId) PSAttempt(com.tencent.angel.master.ps.attempt.PSAttempt) ParameterServerManager(com.tencent.angel.master.ps.ParameterServerManager) ParameterServerId(com.tencent.angel.ps.ParameterServerId) AngelException(com.tencent.angel.exception.AngelException) Test(org.junit.Test)

Aggregations

ParameterServerManager (com.tencent.angel.master.ps.ParameterServerManager)6 Test (org.junit.Test)5 Location (com.tencent.angel.common.location.Location)4 AngelException (com.tencent.angel.exception.AngelException)4 TConnection (com.tencent.angel.ipc.TConnection)4 PSAttempt (com.tencent.angel.master.ps.attempt.PSAttempt)4 AMParameterServer (com.tencent.angel.master.ps.ps.AMParameterServer)4 PSAttemptId (com.tencent.angel.ps.PSAttemptId)3 ParameterServer (com.tencent.angel.ps.ParameterServer)3 ParameterServerId (com.tencent.angel.ps.ParameterServerId)2 AngelDeployMode (com.tencent.angel.AngelDeployMode)1 PartitionKey (com.tencent.angel.PartitionKey)1 RunningMode (com.tencent.angel.RunningMode)1 LocationManager (com.tencent.angel.common.location.LocationManager)1 AppEvent (com.tencent.angel.master.app.AppEvent)1 InternalErrorEvent (com.tencent.angel.master.app.InternalErrorEvent)1 ClientManager (com.tencent.angel.master.client.ClientManager)1 DummyDataSpliter (com.tencent.angel.master.data.DummyDataSpliter)1 LocalContainerAllocator (com.tencent.angel.master.deploy.local.LocalContainerAllocator)1 LocalContainerLauncher (com.tencent.angel.master.deploy.local.LocalContainerLauncher)1