brumi1024 commented on a change in pull request #3470:
URL: https://github.com/apache/hadoop/pull/3470#discussion_r762039753
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java
##########
@@ -818,6 +819,28 @@ public static Resource createResourceWithSameValue(long
value) {
return res;
}
+ public static Resource multiply(Resource lhs, float rhs) {
Review comment:
Very minor nit: the parameter names lhs/rhs while are correct in a
logical sense, I think something like value and multiplier are a bit more
telling.
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/util/resource/ResourceUtils.java
##########
@@ -818,6 +819,28 @@ public static Resource createResourceWithSameValue(long
value) {
return res;
}
+ public static Resource multiply(Resource lhs, float rhs) {
+ Resource newResource = Resource.newInstance(0, 0);
+
+ for (ResourceInformation resourceInformation : lhs.getResources()) {
+ newResource.setResourceValue(resourceInformation.getName(),
+ (long) Math.floor(resourceInformation.getValue() * rhs));
+ }
+
+ return newResource;
+ }
+
+ public static Resource multiplyRound(Resource lhs, float rhs) {
Review comment:
Same as above.
##########
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/AbstractCSQueue.java
##########
@@ -558,11 +576,25 @@ public Resource getEffectiveMaxCapacityDown(String label,
Resource factor) {
}
@Override
- public QueueCapacityVector getConfiguredCapacityVector(
- String label) {
+ public QueueCapacityVector getConfiguredCapacityVector(String label) {
return configuredCapacityVectors.get(label);
}
+ @Override
+ public QueueCapacityVector getConfiguredMaximumCapacityVector(String label) {
Review comment:
Nit: Could this be called either getConfiguredMaxCapacityVector? Because
if I'm not mistaken the setter uses Max abbreviation, while the getter has
Maximum written out completely.
##########
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/AbsoluteResourceCapacityCalculator.java
##########
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity;
+
+import
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacityVector.ResourceUnitCapacityType;
+
+public class AbsoluteResourceCapacityCalculator extends
AbstractQueueCapacityCalculator {
Review comment:
We were talking about it before and I was wondering: would this commit
be a good time to introduce a new name to this capacity declaring mode? For
example ResourceCapacity is less confusing, as internally the absolute capacity
is used for other purposes.
##########
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
##########
@@ -2767,6 +2807,14 @@ public String getMultiNodesSortingAlgorithmPolicy(
return normalizePolicyName(policyClassName.trim());
}
+ public boolean isLegacyQueueMode() {
+ return getBoolean(LEGACY_QUEUE_MODE_ENABLED, DEFAULT_LEGACY_QUEUE_MODE);
+ }
+
+ public void setLegacyQueueModeEnabled(boolean value) {
+ setBoolean(LEGACY_QUEUE_MODE_ENABLED, false);
Review comment:
Is this purposely hardcoded false?
--
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]