YARN-1370. Fair scheduler to re-populate container allocation state. (Anubhav Dhoot via kasha)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1617647 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
79871ae699
commit
e6799af4d3
|
@ -107,6 +107,9 @@ Release 2.6.0 - UNRELEASED
|
||||||
YARN-2399. FairScheduler: Merge AppSchedulable and FSSchedulerApp into
|
YARN-2399. FairScheduler: Merge AppSchedulable and FSSchedulerApp into
|
||||||
FSAppAttempt. (kasha)
|
FSAppAttempt. (kasha)
|
||||||
|
|
||||||
|
YARN-1370. Fair scheduler to re-populate container allocation state.
|
||||||
|
(Anubhav Dhoot via kasha)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -1150,6 +1150,8 @@ public class FairScheduler extends
|
||||||
}
|
}
|
||||||
NodeAddedSchedulerEvent nodeAddedEvent = (NodeAddedSchedulerEvent)event;
|
NodeAddedSchedulerEvent nodeAddedEvent = (NodeAddedSchedulerEvent)event;
|
||||||
addNode(nodeAddedEvent.getAddedRMNode());
|
addNode(nodeAddedEvent.getAddedRMNode());
|
||||||
|
recoverContainersOnNode(nodeAddedEvent.getContainerReports(),
|
||||||
|
nodeAddedEvent.getAddedRMNode());
|
||||||
break;
|
break;
|
||||||
case NODE_REMOVED:
|
case NODE_REMOVED:
|
||||||
if (!(event instanceof NodeRemovedSchedulerEvent)) {
|
if (!(event instanceof NodeRemovedSchedulerEvent)) {
|
||||||
|
|
|
@ -57,6 +57,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.Capacity
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.ParentQueue;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.ParentQueue;
|
||||||
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
|
||||||
import org.apache.hadoop.yarn.util.resource.DominantResourceCalculator;
|
import org.apache.hadoop.yarn.util.resource.DominantResourceCalculator;
|
||||||
import org.apache.hadoop.yarn.util.resource.ResourceCalculator;
|
import org.apache.hadoop.yarn.util.resource.ResourceCalculator;
|
||||||
|
@ -107,7 +108,7 @@ public class TestWorkPreservingRMRestart {
|
||||||
@Parameterized.Parameters
|
@Parameterized.Parameters
|
||||||
public static Collection<Object[]> getTestParameters() {
|
public static Collection<Object[]> getTestParameters() {
|
||||||
return Arrays.asList(new Object[][] { { CapacityScheduler.class },
|
return Arrays.asList(new Object[][] { { CapacityScheduler.class },
|
||||||
{ FifoScheduler.class } });
|
{ FifoScheduler.class }, {FairScheduler.class } });
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestWorkPreservingRMRestart(Class<?> schedulerClass) {
|
public TestWorkPreservingRMRestart(Class<?> schedulerClass) {
|
||||||
|
@ -224,7 +225,11 @@ public class TestWorkPreservingRMRestart {
|
||||||
assertTrue(schedulerAttempt.getLiveContainers().contains(
|
assertTrue(schedulerAttempt.getLiveContainers().contains(
|
||||||
scheduler.getRMContainer(runningContainer.getContainerId())));
|
scheduler.getRMContainer(runningContainer.getContainerId())));
|
||||||
assertEquals(schedulerAttempt.getCurrentConsumption(), usedResources);
|
assertEquals(schedulerAttempt.getCurrentConsumption(), usedResources);
|
||||||
assertEquals(availableResources, schedulerAttempt.getHeadroom());
|
|
||||||
|
// Until YARN-1959 is resolved
|
||||||
|
if (scheduler.getClass() != FairScheduler.class) {
|
||||||
|
assertEquals(availableResources, schedulerAttempt.getHeadroom());
|
||||||
|
}
|
||||||
|
|
||||||
// *********** check appSchedulingInfo state ***********
|
// *********** check appSchedulingInfo state ***********
|
||||||
assertEquals((1 << 22) + 1, schedulerAttempt.getNewContainerId());
|
assertEquals((1 << 22) + 1, schedulerAttempt.getNewContainerId());
|
||||||
|
|
Loading…
Reference in New Issue