hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject [41/42] hadoop git commit: YARN-7067. [YARN-3926] Optimize ResourceType information display in UI. Contributed by Wangda Tan.
Date Tue, 22 Aug 2017 23:16:15 GMT
YARN-7067. [YARN-3926] Optimize ResourceType information display in UI. Contributed by Wangda
Tan.


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

Branch: refs/heads/YARN-3926
Commit: b78f1b730e793a11ea7bfbb9c50f44db2a9ae32a
Parents: dd85313
Author: Sunil G <sunilg@apache.org>
Authored: Tue Aug 22 16:59:29 2017 +0530
Committer: Wangda Tan <wangda@apache.org>
Committed: Tue Aug 22 16:05:19 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/yarn/api/records/ResourceTypeInfo.java |  7 +++++--
 .../resourcemanager/webapp/MetricsOverviewTable.java     | 11 ++++++++---
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b78f1b73/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceTypeInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceTypeInfo.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceTypeInfo.java
index 6cb470c..d85cf0c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceTypeInfo.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceTypeInfo.java
@@ -153,8 +153,11 @@ public abstract class ResourceTypeInfo implements Comparable<ResourceTypeInfo>
{
 
   @Override
   public String toString() {
-    return "name: " + this.getName() + ", units: " + this.getDefaultUnit()
-        + ", type: " + getResourceType();
+    StringBuilder sb = new StringBuilder();
+    sb.append("<name=").append(this.getName()).append(" default-unit=").append(
+        this.getDefaultUnit()).append(" type=" + getResourceType()).append(
+        ">");
+    return sb.toString();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b78f1b73/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/MetricsOverviewTable.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/webapp/MetricsOverviewTable.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/MetricsOverviewTable.java
index f6b1a94..806b636 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/MetricsOverviewTable.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/MetricsOverviewTable.java
@@ -19,17 +19,21 @@
 package org.apache.hadoop.yarn.server.resourcemanager.webapp;
 
 import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.yarn.api.records.ResourceTypeInfo;
 import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
 import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterMetricsInfo;
 import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerInfo;
 import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.UserMetricsInfo;
 
+import org.apache.hadoop.yarn.util.resource.ResourceUtils;
 import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet;
 import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.DIV;
 import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
 
 import com.google.inject.Inject;
 
+import java.util.Arrays;
+
 /**
  * Provides an table with an overview of many cluster wide metrics and if
  * per user metrics are enabled it will show an overview of what the
@@ -168,8 +172,8 @@ public class MetricsOverviewTable extends HtmlBlock {
         
       }
     }
-    
-    SchedulerInfo schedulerInfo=new SchedulerInfo(this.rm);
+
+    SchedulerInfo schedulerInfo = new SchedulerInfo(this.rm);
     
     div.h3("Scheduler Metrics").
     table("#schedulermetricsoverview").
@@ -186,7 +190,8 @@ public class MetricsOverviewTable extends HtmlBlock {
     tbody().$class("ui-widget-content").
       tr().
         td(String.valueOf(schedulerInfo.getSchedulerType())).
-        td(String.valueOf(schedulerInfo.getSchedulerResourceTypes())).
+        td(String.valueOf(Arrays.toString(ResourceUtils.getResourcesTypeInfo()
+            .toArray(new ResourceTypeInfo[0])))).
         td(schedulerInfo.getMinAllocation().toString()).
         td(schedulerInfo.getMaxAllocation().toString()).
         td(String.valueOf(schedulerInfo.getMaxClusterLevelAppPriority())).


---------------------------------------------------------------------
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