You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Jonathan Hung (Jira)" <ji...@apache.org> on 2019/12/05 22:12:00 UTC
[jira] [Comment Edited] (YARN-10012) Guaranteed and max capacity
queue metrics for custom resources
[ https://issues.apache.org/jira/browse/YARN-10012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16989202#comment-16989202 ]
Jonathan Hung edited comment on YARN-10012 at 12/5/19 10:11 PM:
----------------------------------------------------------------
Thanks [~manirajv06@gmail.com]. A few comments:
* We should move the additions in QueueMetricsForCustomResources to a separate class, perhaps CSQueueMetricsForCustomResources (which inherits from QueueMetricsForCustomResources). We'll have to change this bit in the QueueMetrics constructor:
{noformat}
if (ResourceUtils.getNumberOfKnownResourceTypes() > 2) {
this.queueMetricsForCustomResources =
new QueueMetricsForCustomResources();
registerCustomResources();
} {noformat}
Perhaps we can just create a {{createQueueMetricsForCustomResources}} method in QueueMetrics which returns {{new QueueMetricsForCustomResources();}}, and have CSQueueMetrics override this metric to return {{new CSQueueMetricsForCustomResources();}}
* Let's rename QueueMetrics#getQueueMetricsForCustomResource to QueueMetrics#getQueueMetricsForCustomResources
* Should we rename MAXIMUM_CAPACITY_METRIC_PREFIX to MaxCapacity instead of MaximumCapacity? To match the existing MaxCapacityMB metric.
* For the test case:
{noformat}
RMNode n1 = MockNodes.newNodeInfo(0,
MockNodes.newResource(50 * GB, 50,
ImmutableMap.<String, String> builder()
.put(TestQueueMetricsForCustomResources.CUSTOM_RES_1,
String.valueOf(10 * GB))
.build()),
1, "n1");
RMNode n2 = MockNodes.newNodeInfo(0,
MockNodes.newResource(50 * GB, 50,
ImmutableMap.<String, String> builder()
.put(TestQueueMetricsForCustomResources.CUSTOM_RES_1,
String.valueOf(20 * GB))
.build()),
2, "n2");{noformat}
any reason the custom resource uses GB as a multiplier? It's a bit confusing.
* Not sure I understand this assert.
{noformat}
Map<String, Long> guaranteedCap_A11 =
((CSQueueMetrics) cs.getQueue("a1").getMetrics())
.getQueueMetricsForCustomResource().getGuaranteedCapacity();
assertEquals(0 * GB, guaranteedCap_A11
.get(TestQueueMetricsForCustomResources.CUSTOM_RES_1).longValue());
{noformat}
I guess it should be (10*GB + 20*GB)* 0.105 (A capacity) * 0.30 (A1 capacity). But since we're setting min allocation for this custom resource to 1024, it's rounding to 0. I think for all of the asserts which check for CUSTOM_RES_1 metrics, we should remove the GB multiplier (related to the above comment). Perhaps we can set the node capability for the custom resource to something like 1000 (for n1) and 2000 (for n2), and set the min/max allocations for the custom resource to something much smaller - min can be 1 (so that we get exact numbers for the guaranteed/max-capacity metrics), max can be anything > 1 I think.
* An extra {{assertEquals(10240, ((CSQueueMetrics)cs.getQueue("a").getMetrics()).getGuaranteedMB());}} line was added in the test case, we don't need this
was (Author: jhung):
Thanks [~manirajv06@gmail.com]. A few comments:
* We should move the additions in QueueMetricsForCustomResources to a separate class, perhaps CSQueueMetricsForCustomResources (which inherits from QueueMetricsForCustomResources). We'll have to change this bit in the QueueMetrics constructor:
{noformat}
if (ResourceUtils.getNumberOfKnownResourceTypes() > 2) {
this.queueMetricsForCustomResources =
new QueueMetricsForCustomResources();
registerCustomResources();
} {noformat}
Perhaps we can just create a {{createQueueMetricsForCustomResources}} method in QueueMetrics which returns {{new QueueMetricsForCustomResources();}}, and have CSQueueMetrics override this metric to return {{new CSQueueMetricsForCustomResources();}}
* Let's rename QueueMetrics#getQueueMetricsForCustomResource to QueueMetrics#getQueueMetricsForCustomResources
* Should we rename MAXIMUM_CAPACITY_METRIC_PREFIX to MaxCapacity instead of MaximumCapacity? To match the existing MaxCapacityMB metric.
* For the test case:
{noformat}
RMNode n1 = MockNodes.newNodeInfo(0,
MockNodes.newResource(50 * GB, 50,
ImmutableMap.<String, String> builder()
.put(TestQueueMetricsForCustomResources.CUSTOM_RES_1,
String.valueOf(10 * GB))
.build()),
1, "n1");
RMNode n2 = MockNodes.newNodeInfo(0,
MockNodes.newResource(50 * GB, 50,
ImmutableMap.<String, String> builder()
.put(TestQueueMetricsForCustomResources.CUSTOM_RES_1,
String.valueOf(20 * GB))
.build()),
2, "n2");
{noformat}
> Guaranteed and max capacity queue metrics for custom resources
> --------------------------------------------------------------
>
> Key: YARN-10012
> URL: https://issues.apache.org/jira/browse/YARN-10012
> Project: Hadoop YARN
> Issue Type: Improvement
> Reporter: Jonathan Hung
> Assignee: Manikandan R
> Priority: Major
> Attachments: YARN-10012.001.patch
>
>
> YARN-9085 adds support for guaranteed/maxcapacity MB/vcores. We should add the same for custom resources.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org