private CSAssignment allocateFromReservedContainer(Resource clusterResource, CandidateNodeSet<FiCaSchedulerNode> candidates, ResourceLimits currentResourceLimits, SchedulingMode schedulingMode) { // Considering multi-node scheduling, its better to iterate through // all candidates and stop once we get atleast one good node to allocate // where reservation was made earlier. In normal case, there is only one // node and hence there wont be any impact after this change. for (FiCaSchedulerNode node : candidates.getAllNodes().values()) { RMContainer reservedContainer = node.getReservedContainer(); if (reservedContainer != null) { FiCaSchedulerApp application = getApplication( reservedContainer.getApplicationAttemptId()); if (null != application) { ActivitiesLogger.APP.startAppAllocationRecording(activitiesManager, node, SystemClock.getInstance().getTime(), application); CSAssignment assignment = application.assignContainers( clusterResource, candidates, currentResourceLimits, schedulingMode, reservedContainer); return assignment; } } } return null; }
if (reservedContainer != null) { FiCaSchedulerApp application = getApplication(reservedContainer.getApplicationAttemptId()); synchronized (application) { return assignReservedContainer(application, node, reservedContainer,
if (reservedContainer != null) { FiCaSchedulerApp application = getApplication(reservedContainer.getApplicationAttemptId()); synchronized (application) { return assignReservedContainer(application, node, reservedContainer,