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