-
Notifications
You must be signed in to change notification settings - Fork 9.2k
YARN-10965. Centralize queue resource calculation based on CapacityVectors #3470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 22 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
86b32bd
YARN-10930. Introduce universal capacity resource vector
9uapaw b935b29
YARN-10930. Cleanup for QueueCapacityVector
9uapaw 5f3c0da
YARN-10965. Introduce enhanced queue calculation
9uapaw 6ee8dc2
YARN-10930. Cover additional test cases
9uapaw ca8016c
YARN-10965. Extend
9uapaw 4fb353c
YARN-10965. Extend 2
9uapaw 8df3901
YARN-10930. Fix review feedbacks
9uapaw 8c6559f
YARN-10965. Simplify calculation
9uapaw 0b7adc8
YARN-10965. Simplify calculators
9uapaw 2bcb962
Merge remote-tracking branch 'origin/trunk' into YARN-10965
9uapaw 83aabd0
YARN-10965. Simplify logic in QueueHandler
9uapaw 3dae1dc
YARN-10965. Implement strict resource iteration order
9uapaw e549acc
YARN-10965. Introduce driver concept to simplify the logic and encaps…
9uapaw 6c629ea
YARN-10965. Fix root driver child queue setting
9uapaw 27e6344
YARN-10965. Fix warnings and nits
9uapaw e6609f2
YARN-10965. Make Absolute calculator use remaining resource ratio as …
9uapaw 784c1be
YARN-10965. Create node label test
9uapaw 0793322
YARN-10965. Make rounding strategies more flexible with regards to ca…
9uapaw 75bca46
YARN-10965. Simplify test API
9uapaw 513555c
YARN-10965. Fix review feedbacks
9uapaw 01c3d5b
Merge branch 'trunk' into YARN-10965
9uapaw ec56a1c
YARN-10965. Fix checkstyle issues
9uapaw 4deb72a
YARN-10965. Introduce calculation iteration context
9uapaw 044cf3b
YARN-10965. Fix review feedbacks
9uapaw c648a82
Merge branch 'trunk' into YARN-10965
9uapaw faa9a9a
YARN-10965. Remove unnecessary change in LeafQueue
9uapaw c16c335
YARN-10965. Fix review feedback
9uapaw 415342d
Merge branch 'trunk' into YARN-10965
9uapaw 785f2fa
YARN-10965. Fix checkstyle issues and nomenclature nits
9uapaw edbf3da
Merge branch 'trunk' into YARN-10965
9uapaw 673a8c0
YARN-10965. Fix javac and spotbugs errors
9uapaw 2958698
Merge branch 'apache:trunk' into YARN-10965
9uapaw ce2618d
Fix checkstyle
szilard-nemeth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...op/yarn/server/resourcemanager/scheduler/capacity/AbsoluteResourceCapacityCalculator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 { | ||
szilard-nemeth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @Override | ||
| public float calculateMinimumResource( | ||
| ResourceCalculationDriver resourceCalculationDriver, String label) { | ||
| String resourceName = resourceCalculationDriver.getCurrentResourceName(); | ||
| float normalizedRatio = resourceCalculationDriver.getNormalizedResourceRatios().getOrDefault( | ||
| label, ResourceVector.of(1)).getValue(resourceName); | ||
| float remainingResourceRatio = resourceCalculationDriver.getRemainingRatioOfResource( | ||
| label, resourceName); | ||
|
|
||
| return normalizedRatio * remainingResourceRatio * resourceCalculationDriver | ||
| .getCurrentMinimumCapacityEntry(label).getResourceValue(); | ||
| } | ||
|
|
||
| @Override | ||
| public float calculateMaximumResource( | ||
| ResourceCalculationDriver resourceCalculationDriver, String label) { | ||
| return resourceCalculationDriver.getCurrentMaximumCapacityEntry(label).getResourceValue(); | ||
| } | ||
|
|
||
| @Override | ||
| public void updateCapacitiesAfterCalculation( | ||
| ResourceCalculationDriver resourceCalculationDriver, String label) { | ||
| setQueueCapacities(resourceCalculationDriver.getUpdateContext().getUpdatedClusterResource( | ||
| label), resourceCalculationDriver.getCurrentChild(), label); | ||
| } | ||
|
|
||
| @Override | ||
| public ResourceUnitCapacityType getCapacityType() { | ||
| return ResourceUnitCapacityType.ABSOLUTE; | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.