9uapaw commented on a change in pull request #3660:
URL: https://github.com/apache/hadoop/pull/3660#discussion_r755099357
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java
##########
@@ -332,7 +336,7 @@ public void verifySubQueueXML(Element qElem, String q,
for (int k = 0; k < qListInfos.getLength(); k++) {
Element qElem3 = (Element) qListInfos.item(k);
String qName3 = WebServicesTestUtils.getXmlString(qElem3,
"queueName");
- String q3 = q + "." + qName3;
+ String q3 = queue + "." + qName3;
Review comment:
It is an append operation, defined for QueuePath.
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CSQueueUtils.java
##########
@@ -36,23 +36,23 @@
/*
* Used only by tests
*/
- public static void checkMaxCapacity(String queuePath,
+ public static void checkMaxCapacity(QueuePath queuePath,
float capacity, float maximumCapacity) {
if (maximumCapacity < 0.0f || maximumCapacity > 1.0f) {
throw new IllegalArgumentException(
"Illegal value of maximumCapacity " + maximumCapacity +
- " used in call to setMaxCapacity for queue " + queuePath);
+ " used in call to setMaxCapacity for queue " +
queuePath.getFullPath());
Review comment:
Calling getFullPath is superfluous, as QueuePath defines toString.
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerConfiguration.java
##########
@@ -834,17 +835,17 @@ private float internalGetLabeledQueueCapacity(String
queue, String label,
}
if (LOG.isDebugEnabled()) {
LOG.debug(
- "CSConf - getCapacityOfLabel: prefix=" + getNodeLabelPrefix(queue,
+ "CSConf - getCapacityOfLabel: prefix=" +
getNodeLabelPrefix(queue.getFullPath(),
Review comment:
Same here.
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CSQueueUtils.java
##########
@@ -36,23 +36,23 @@
/*
* Used only by tests
*/
- public static void checkMaxCapacity(String queuePath,
+ public static void checkMaxCapacity(QueuePath queuePath,
float capacity, float maximumCapacity) {
if (maximumCapacity < 0.0f || maximumCapacity > 1.0f) {
throw new IllegalArgumentException(
"Illegal value of maximumCapacity " + maximumCapacity +
- " used in call to setMaxCapacity for queue " + queuePath);
+ " used in call to setMaxCapacity for queue " +
queuePath.getFullPath());
}
}
/*
* Used only by tests
*/
- public static void checkAbsoluteCapacity(String queuePath,
+ public static void checkAbsoluteCapacity(QueuePath queuePath,
float absCapacity, float absMaxCapacity) {
if (absMaxCapacity < (absCapacity - EPSILON)) {
throw new IllegalArgumentException("Illegal call to setMaxCapacity. "
- + "Queue '" + queuePath + "' has "
+ + "Queue '" + queuePath.getFullPath() + "' has "
Review comment:
Same here.
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestQueuePath.java
##########
@@ -54,6 +54,20 @@ public void testEmptyPart() {
Assert.assertFalse(queuePathWithoutEmptyPart.hasEmptyPart());
}
+ @Test
+ public void testNullPath() {
+ QueuePath queuePathWithNullPath = new QueuePath(null);
+ String parentOfQueueWithNullPath = queuePathWithNullPath.getParent();
+ String leafOfQueueWithNullPath = queuePathWithNullPath.getLeafName();
+ String fullPathOfQueueWithNullPath = queuePathWithNullPath.getFullPath();
+ Boolean isTheQueueWithNullPathRoot = queuePathWithNullPath.isRoot();
Review comment:
No need to Box here, use boolean instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]