public ApplicationId getApplicationId() { return appSchedulingInfo.getApplicationId(); }
public ApplicationId getApplicationId() { return appSchedulingInfo.getApplicationId(); }
public ApplicationId getApplicationId() { return appSchedulingInfo.getApplicationId(); }
private String throwExceptionWithMetaInfo(String message) { StringBuilder sb = new StringBuilder(); sb.append("AppId=").append(appSchedulingInfo.getApplicationId()).append( " Key=").append(this.schedulerRequestKey).append(". Exception message:") .append(message); throw new SchedulerInvalidResoureRequestException(sb.toString()); }
@SuppressWarnings("unchecked") @Override public void initialize(AppSchedulingInfo appSchedulingInfo, SchedulerRequestKey schedulerRequestKey, RMContext rmContext) { super.initialize(appSchedulingInfo, schedulerRequestKey, rmContext); multiNodeSortPolicyName = appSchedulingInfo .getApplicationSchedulingEnvs().get( ApplicationSchedulingConfig.ENV_MULTI_NODE_SORTING_POLICY_CLASS); multiNodeSortingManager = (MultiNodeSortingManager<N>) rmContext .getMultiNodeSortingManager(); if (LOG.isDebugEnabled()) { LOG.debug( "nodeLookupPolicy used for " + appSchedulingInfo .getApplicationId() + " is " + ((multiNodeSortPolicyName != null) ? multiNodeSortPolicyName : "")); } }
private boolean checkCardinalityAndPending(SchedulerNode node) { // Do we still have pending resource? if (schedulingRequest.getResourceSizing().getNumAllocations() <= 0) { return false; } // node type will be ignored. try { return PlacementConstraintsUtil.canSatisfyConstraints( appSchedulingInfo.getApplicationId(), schedulingRequest, node, placementConstraintManager, allocationTagsManager); } catch (InvalidAllocationTagsQueryException e) { LOG.warn("Failed to query node cardinality:", e); return false; } }
@Before public void setup() throws Exception { // stub app scheduling info. appSchedulingInfo = mock(AppSchedulingInfo.class); when(appSchedulingInfo.getApplicationId()).thenReturn( TestUtils.getMockApplicationId(1)); when(appSchedulingInfo.getApplicationAttemptId()).thenReturn( TestUtils.getMockApplicationAttemptId(1, 1)); // stub RMContext rmContext = TestUtils.getMockRMContext(); // Create allocation tags manager AllocationTagsManager allocationTagsManager = new AllocationTagsManager( rmContext); PlacementConstraintManager placementConstraintManager = new MemoryPlacementConstraintManager(); spyAllocationTagsManager = spy(allocationTagsManager); schedulerRequestKey = new SchedulerRequestKey(Priority.newInstance(1), 2L, TestUtils.getMockContainerId(1, 1)); rmContext.setAllocationTagsManager(spyAllocationTagsManager); rmContext.setPlacementConstraintManager(placementConstraintManager); // Create allocator allocator = new SingleConstraintAppPlacementAllocator(); allocator.initialize(appSchedulingInfo, schedulerRequestKey, rmContext); }
checkApps(queueSource, 1, 1, 0, 0, 0, 0, true); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(queueSource, 1, 1, 0, 0, 0, 0, true); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(queueSource, 1, 1, 0, 0, 0, 0, true); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true);
checkApps(queueSource, 1, 1, 0, 0, 0, 0, true); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(queueSource, 1, 1, 0, 0, 0, 0, true); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(queueSource, 1, 1, 0, 0, 0, 0, true); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true);
metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); metrics.finishApp(user, RMAppState.FINISHED);
metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); metrics.finishApp(user, RMAppState.FINISHED);
checkResources(userSource, 0, 0, 0, 0, 0, 10*GB, 10, 15*GB, 15, 5, 0, 0, 0); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); checkApps(userSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(userSource, 1, 0, 0, 0, 0, 0, true);
checkResources(userSource, 0, 0, 0, 0, 0, 10*GB, 10, 15*GB, 15, 5, 0, 0, 0); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); checkApps(userSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(userSource, 1, 0, 0, 0, 0, 0, true);
checkResources(parentUserSource, 0, 0, 0, 0, 0, 10*GB, 10, 15*GB, 15, 5, 0, 0, 0); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); checkApps(userSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(parentQueueSource, 1, 0, 0, 0, 0, 0, true);
checkResources(parentUserSource, 0, 0, 0, 0, 0, 10*GB, 10, 15*GB, 15, 5, 0, 0, 0); metrics.runAppAttempt(app.getApplicationId(), user); checkApps(queueSource, 1, 0, 1, 0, 0, 0, true); checkApps(userSource, 1, 0, 1, 0, 0, 0, true); app.getApplicationId(), app.isPending(), app.getUser()); checkApps(queueSource, 1, 0, 0, 0, 0, 0, true); checkApps(parentQueueSource, 1, 0, 0, 0, 0, 0, true);