@Test(timeout = 60000) public void testStartStopServer() throws Exception { ApplicationHistoryServer historyServer = new ApplicationHistoryServer(); Configuration config = new YarnConfiguration(); config.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE, MemoryTimelineStore.class, TimelineStore.class); config.set(YarnConfiguration.TIMELINE_SERVICE_WEBAPP_ADDRESS, "localhost:0"); try { historyServer.init(config); assertEquals(STATE.INITED, historyServer.getServiceState()); assertEquals(5, historyServer.getServices().size()); ApplicationHistoryClientService historyService = historyServer.getClientService(); assertNotNull(historyServer.getClientService()); assertEquals(STATE.INITED, historyService.getServiceState()); historyServer.start(); assertEquals(STATE.STARTED, historyServer.getServiceState()); assertEquals(STATE.STARTED, historyService.getServiceState()); historyServer.stop(); assertEquals(STATE.STOPPED, historyServer.getServiceState()); } finally { historyServer.stop(); } }
@Private @VisibleForTesting ApplicationHistoryClientService getClientService() { return this.ahsClientService; }
ApplicationHistoryServer extends CompositeService { @Private @VisibleForTesting ApplicationHistoryClientService getClientService() { return this.ahsClientService; } }
ApplicationHistoryServer extends CompositeService { @Private @VisibleForTesting ApplicationHistoryClientService getClientService() { return this.ahsClientService; } ApplicationHistoryServer(); }
ApplicationHistoryServer extends CompositeService { @Private @VisibleForTesting ApplicationHistoryClientService getClientService() { return this.ahsClientService; } ApplicationHistoryServer(); @Private @VisibleForTesting int getPort(); @Private @VisibleForTesting TimelineStore getTimelineStore(); static void main(String[] args); }
ApplicationHistoryServer extends CompositeService { @Private @VisibleForTesting ApplicationHistoryClientService getClientService() { return this.ahsClientService; } ApplicationHistoryServer(); @Private @VisibleForTesting int getPort(); @Private @VisibleForTesting TimelineStore getTimelineStore(); static void main(String[] args); static final int SHUTDOWN_HOOK_PRIORITY; }