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/branches/branch-2@1569929 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sanford Ryza 2014-02-19 21:37:24 +00:00
parent a5d2398377
commit 34baa74273
3 changed files with 16 additions and 2 deletions

View File

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

View File

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

View File

@ -106,6 +106,17 @@ public class TestQueuePlacementPolicy {
parse(sb.toString()); 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 { private QueuePlacementPolicy parse(String str) throws Exception {
// Read and parse the allocations file. // Read and parse the allocations file.
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory docBuilderFactory =