From b722c52f4ede4c19c76a7947583fd6104e2c908a Mon Sep 17 00:00:00 2001 From: Peter Bacsko Date: Mon, 22 Feb 2021 12:55:45 +0100 Subject: [PATCH] YARN-10513. CS Flexible Auto Queue Creation RM UIv2 modifications. Contributed by Andras Gyori. --- .../yarn-queue-partition-capacity-labels.js | 14 +++++++- .../app/models/yarn-queue/capacity-queue.js | 13 +++++++ .../serializers/yarn-queue/capacity-queue.js | 5 +++ .../yarn-queue-partition-capacity-labels.hbs | 22 +++++++++++- .../main/webapp/app/templates/yarn-queue.hbs | 36 ++++++++++++++----- 5 files changed, 80 insertions(+), 10 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/yarn-queue-partition-capacity-labels.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/yarn-queue-partition-capacity-labels.js index e7f9c03f356..788155c3877 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/yarn-queue-partition-capacity-labels.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/yarn-queue-partition-capacity-labels.js @@ -37,12 +37,24 @@ export default Ember.Component.extend({ const userLimit = queue.get("userLimit"); const userLimitFactor = queue.get("userLimitFactor"); const isLeafQueue = queue.get("isLeafQueue"); + const isWeightMode = queue.get("isWeightMode"); + const isFlexibleDynamicQueue = queue.get("isFlexibleDynamicQueue"); + const weight = queue.get("weight"); + const orderingPolicy = queue.get("orderingPolicy"); + const normalizedWeight = queue.get("normalizedWeight"); + const creationMethod = queue.get("creationMethod"); return { ...partitionMap[filteredParition], userLimit, userLimitFactor, - isLeafQueue + isLeafQueue, + isWeightMode, + weight, + normalizedWeight, + orderingPolicy, + creationMethod, + isFlexibleDynamicQueue }; } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js index ebcccb9eec3..885c6a52154 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-queue/capacity-queue.js @@ -21,6 +21,7 @@ import Converter from 'yarn-ui/utils/converter'; export default DS.Model.extend({ name: DS.attr("string"), + path: DS.attr("string"), children: DS.attr("array"), parent: DS.attr("string"), capacity: DS.attr("number"), @@ -31,6 +32,10 @@ export default DS.Model.extend({ absCapacity: DS.attr("number"), absMaxCapacity: DS.attr("number"), absUsedCapacity: DS.attr("number"), + weight: DS.attr("number"), + normalizedWeight: DS.attr("number"), + creationMethod: DS.attr("string"), + orderingPolicy: DS.attr("string"), state: DS.attr("string"), userLimit: DS.attr("number"), userLimitFactor: DS.attr("number"), @@ -49,6 +54,14 @@ export default DS.Model.extend({ return len <= 0; }.property("children"), + isWeightMode: function() { + return this.get("weight") !== -1; + }.property("children"), + + isFlexibleDynamicQueue: function() { + return this.get("creationMethod") === "dynamicFlexible"; + }.property("children"), + capacitiesBarChartData: function() { var floatToFixed = Converter.floatToFixed; return [ diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js index 2dec5205fdd..e9ce25d2cb8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-queue/capacity-queue.js @@ -92,6 +92,7 @@ export default DS.JSONAPISerializer.extend({ type: primaryModelClass.modelName, // yarn-queue attributes: { name: payload.queueName, + path: payload.queuePath, parent: payload.myParent, children: children, capacity: payload.capacity, @@ -100,7 +101,11 @@ export default DS.JSONAPISerializer.extend({ absCapacity: payload.absoluteCapacity, absMaxCapacity: payload.absoluteMaxCapacity, absUsedCapacity: payload.absoluteUsedCapacity, + weight: payload.weight, + normalizedWeight: payload.normalizedWeight, + creationMethod: payload.creationMethod, state: payload.state, + orderingPolicy: payload.orderingPolicyInfo, userLimit: payload.userLimit, userLimitFactor: payload.userLimitFactor, preemptionDisabled: payload.preemptionDisabled, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue-partition-capacity-labels.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue-partition-capacity-labels.hbs index fdecb2de310..a84538da8d2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue-partition-capacity-labels.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/yarn-queue-partition-capacity-labels.hbs @@ -30,6 +30,18 @@ {{data.absoluteMaxCapacity}}% +{{#if data.isWeightMode}} +
+ + weight + {{data.weight}} + + + normalized weight + {{data.normalizedWeight}} + +
+{{else}}
configured capacity @@ -40,6 +52,7 @@ {{data.maxCapacity}}%
+{{/if}} {{#if data.isLeafQueue}}
@@ -51,4 +64,11 @@ {{data.userLimitFactor}}
-{{/if}} \ No newline at end of file +{{/if}} +{{#if data.isFlexibleDynamicQueue}} +
+ + flexible dynamic queue + +
+{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs index 8024ffa0c73..b65a3be69e4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue.hbs @@ -31,14 +31,34 @@ {{/if}} {{#if (eq model.queues.firstObject.type "capacity")}}
- - configured capacity - {{model.selectedQueue.capacity}}% - - - configured max capacity - {{model.selectedQueue.maxCapacity}}% - + {{#if model.selectedQueue.isWeightMode}} + + weight + {{model.selectedQueue.weight}} + + + normalized weight + {{model.selectedQueue.normalizedWeight}} + + {{else}} + + configured capacity + {{model.selectedQueue.capacity}}% + + + configured max capacity + {{model.selectedQueue.maxCapacity}}% + + {{/if}} + + ordering policy + {{model.selectedQueue.orderingPolicy}} + + {{#if model.selectedQueue.isFlexibleDynamicQueue}} + + flexible dynamic queue + + {{/if}} {{#if model.selectedQueue.isLeafQueue}} user limit