hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rohithsharm...@apache.org
Subject hadoop git commit: YARN-7699. queueUsagePercentage is coming as INF for getApp REST api call. Contributed by Sunil G.
Date Mon, 08 Jan 2018 10:31:20 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.9 c1d48cbda -> 8e0a5b151


YARN-7699. queueUsagePercentage is coming as INF for getApp REST api call. Contributed by
Sunil G.

(cherry picked from commit 281350674c70d65233363849a8b60e9b7dc965cf)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8e0a5b15
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8e0a5b15
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8e0a5b15

Branch: refs/heads/branch-2.9
Commit: 8e0a5b1514d6060cd16612e80932339696583a69
Parents: c1d48cb
Author: Rohith Sharma K S <rohithsharmaks@apache.org>
Authored: Mon Jan 8 15:52:03 2018 +0530
Committer: Rohith Sharma K S <rohithsharmaks@apache.org>
Committed: Mon Jan 8 15:57:56 2018 +0530

----------------------------------------------------------------------
 .../scheduler/common/fica/FiCaSchedulerApp.java          | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8e0a5b15/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java
index cb6ff31..1d91316 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java
@@ -995,14 +995,17 @@ public class FiCaSchedulerApp extends SchedulerApplicationAttempt {
               getAppAMNodePartitionName(), cluster);
       ResourceCalculator calc =
           rmContext.getScheduler().getResourceCalculator();
+      float queueUsagePerc = 0.0f;
       if (!calc.isInvalidDivisor(totalPartitionRes)) {
         float queueAbsMaxCapPerPartition =
             ((AbstractCSQueue) getQueue()).getQueueCapacities()
                 .getAbsoluteCapacity(getAppAMNodePartitionName());
-        float queueUsagePerc = calc.divide(totalPartitionRes,
-            report.getUsedResources(),
-            Resources.multiply(totalPartitionRes, queueAbsMaxCapPerPartition))
-            * 100;
+        if (queueAbsMaxCapPerPartition != 0) {
+          queueUsagePerc = calc.divide(totalPartitionRes,
+              report.getUsedResources(),
+              Resources.multiply(totalPartitionRes, queueAbsMaxCapPerPartition))
+              * 100;
+        }
         report.setQueueUsagePercentage(queueUsagePerc);
       }
       return report;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message