YARN-1718. Fix a couple isTerminals in Fair Scheduler queue placement rules (Sandy Ryza)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1569928 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sanford Ryza 2014-02-19 21:36:51 +00:00
parent 62d791b1ee
commit 0e3e91a06d
3 changed files with 16 additions and 2 deletions

View File

@ -29,6 +29,9 @@ Release 2.5.0 - UNRELEASED
BUG FIXES
YARN-1718. Fix a couple isTerminals in Fair Scheduler queue placement rules
(Sandy Ryza)
Release 2.4.0 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -162,7 +162,7 @@ public abstract class QueuePlacementRule {
@Override
public boolean isTerminal() {
return create;
return false;
}
}
@ -201,7 +201,7 @@ public abstract class QueuePlacementRule {
@Override
public boolean isTerminal() {
return create;
return true;
}
}

View File

@ -106,6 +106,17 @@ public class TestQueuePlacementPolicy {
parse(sb.toString());
}
@Test
public void testTerminals() throws Exception {
// Should make it through without an exception
StringBuffer sb = new StringBuffer();
sb.append("<queuePlacementPolicy>");
sb.append(" <rule name='secondaryGroupExistingQueue' create='true'/>");
sb.append(" <rule name='default' create='false'/>");
sb.append("</queuePlacementPolicy>");
parse(sb.toString());
}
private QueuePlacementPolicy parse(String str) throws Exception {
// Read and parse the allocations file.
DocumentBuilderFactory docBuilderFactory =