@Override public SchedulerAppReport getSchedulerAppInfo( ApplicationAttemptId attemptId) { return scheduler.getSchedulerAppInfo(attemptId); }
@Override public Integer getValue() { SchedulerAppReport app = scheduler.getSchedulerAppInfo(appAttemptId); return app.getLiveContainers().size(); } }
@Override public Integer getValue() { SchedulerAppReport app = scheduler.getSchedulerAppInfo(appAttemptId); return app.getReservedContainers().size(); } }
this.rmContext.getScheduler().getSchedulerAppInfo(appAttemptId); if (schedulerAppReport != null) { rmContainers = schedulerAppReport.getLiveContainers();
this.rmContext.getScheduler().getSchedulerAppInfo(appAttemptId); if (schedulerAppReport != null) { rmContainers = schedulerAppReport.getLiveContainers();
this.rmContext.getScheduler().getSchedulerAppInfo(appAttemptId); if (schedulerAppReport != null) { rmContainers = schedulerAppReport.getLiveContainers();
appRemoveEvent.getApplicationAttemptID(); String queue = appQueueMap.get(appAttemptId.getApplicationId()); SchedulerAppReport app = scheduler.getSchedulerAppInfo(appAttemptId); if (! app.getLiveContainers().isEmpty()) { // have 0 or 1
SchedulerAppReport sAppReport = mock(SchedulerAppReport.class); when( rmContext.getScheduler().getSchedulerAppInfo( any(ApplicationAttemptId.class))).thenReturn(sAppReport); List<RMContainer> rmContainers = new ArrayList<RMContainer>(); rmContainers.add(containerimpl); when( rmContext.getScheduler().getSchedulerAppInfo(attemptId) .getLiveContainers()).thenReturn(rmContainers); ContainerStatus cs = mock(ContainerStatus.class);
SchedulerAppReport sAppReport = mock(SchedulerAppReport.class); when( rmContext.getScheduler().getSchedulerAppInfo( any(ApplicationAttemptId.class))).thenReturn(sAppReport); List<RMContainer> rmContainers = new ArrayList<RMContainer>(); rmContainers.add(containerimpl); when( rmContext.getScheduler().getSchedulerAppInfo(attemptId) .getLiveContainers()).thenReturn(rmContainers); ContainerStatus cs = mock(ContainerStatus.class);
for (ContainerStatus status : info.getCompletedContainers()) { ContainerId containerId = status.getContainerId(); SchedulerAppReport app = scheduler.getSchedulerAppInfo( containerId.getApplicationAttemptId());
SchedulerAppReport report = scheduler.getSchedulerAppInfo(attemptId); for (ContainerId containerId : containerIds) { Container container = null;
.getSchedulerAppInfo(am0.getApplicationAttemptId()) .getLiveContainers(); rmContainers = rm.scheduler.getSchedulerAppInfo(attempt2.getAppAttemptId()) .getLiveContainers();
.getSchedulerAppInfo(am0.getApplicationAttemptId()) .getLiveContainers(); rmContainers = rm.scheduler.getSchedulerAppInfo(attempt2.getAppAttemptId()) .getLiveContainers();
.getSchedulerAppInfo(attempt0.getAppAttemptId()) .getLiveContainers();
.getSchedulerAppInfo(attempt0.getAppAttemptId()) .getLiveContainers();
@Test (timeout = 20000) public void testRecoverSchedulerAppAndAttemptSynchronously() throws Exception { // start RM rm1 = new MockRM(conf); rm1.start(); MockNM nm1 = new MockNM("127.0.0.1:1234", 15120, rm1.getResourceTrackerService()); nm1.registerNode(); // create app and launch the AM RMApp app0 = rm1.submitApp(200); MockAM am0 = MockRM.launchAndRegisterAM(app0, rm1, nm1); rm2 = new MockRM(conf, rm1.getRMStateStore()); rm2.start(); nm1.setResourceTrackerService(rm2.getResourceTrackerService()); // scheduler app/attempt is immediately available after RM is re-started. Assert.assertNotNull(rm2.getResourceScheduler().getSchedulerAppInfo( am0.getApplicationAttemptId())); // getTransferredContainers should not throw NPE. rm2.getResourceScheduler() .getTransferredContainers(am0.getApplicationAttemptId()); List<NMContainerStatus> containers = createNMContainerStatusForApp(am0); nm1.registerNode(containers, null); waitForNumContainersToRecover(2, rm2, am0.getApplicationAttemptId()); }
@Test (timeout = 20000) public void testRecoverSchedulerAppAndAttemptSynchronously() throws Exception { // start RM MemoryRMStateStore memStore = new MemoryRMStateStore(); memStore.init(conf); rm1 = new MockRM(conf, memStore); rm1.start(); MockNM nm1 = new MockNM("127.0.0.1:1234", 15120, rm1.getResourceTrackerService()); nm1.registerNode(); // create app and launch the AM RMApp app0 = rm1.submitApp(200); MockAM am0 = MockRM.launchAndRegisterAM(app0, rm1, nm1); rm2 = new MockRM(conf, memStore); rm2.start(); nm1.setResourceTrackerService(rm2.getResourceTrackerService()); // scheduler app/attempt is immediately available after RM is re-started. Assert.assertNotNull(rm2.getResourceScheduler().getSchedulerAppInfo( am0.getApplicationAttemptId())); // getTransferredContainers should not throw NPE. ((AbstractYarnScheduler) rm2.getResourceScheduler()) .getTransferredContainers(am0.getApplicationAttemptId()); List<NMContainerStatus> containers = createNMContainerStatusForApp(am0); nm1.registerNode(containers, null); waitForNumContainersToRecover(2, rm2, am0.getApplicationAttemptId()); }