storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/2] storm git commit: STORM-3183: Fix for visualization on Storm API
Date Sat, 11 Aug 2018 11:55:55 GMT
Repository: storm
Updated Branches:
  refs/heads/master 154173a70 -> c2931dab7


STORM-3183: Fix for visualization on Storm API


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

Branch: refs/heads/master
Commit: 078e8cc239788bbec14a0e38492ed683341af7dc
Parents: 16e5008
Author: Govind Menon <govindappumenon@gmail.com>
Authored: Thu Aug 9 13:51:10 2018 -0500
Committer: Govind Menon <govindappumenon@gmail.com>
Committed: Fri Aug 10 17:25:05 2018 -0500

----------------------------------------------------------------------
 .../org/apache/storm/daemon/ui/UIHelpers.java   | 49 ++++++++++----------
 1 file changed, 24 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/078e8cc2/storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java
----------------------------------------------------------------------
diff --git a/storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java b/storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java
index d6dc409..a080599 100644
--- a/storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java
+++ b/storm-webapp/src/main/java/org/apache/storm/daemon/ui/UIHelpers.java
@@ -1348,12 +1348,12 @@ public class UIHelpers {
      */
     public static Map<String, Object> getStatMapFromExecutorSummary(ExecutorSummary
executorSummary) {
         Map<String, Object> result = new HashMap();
-        result.put("host", executorSummary.get_host());
-        result.put("port", executorSummary.get_port());
-        result.put("uptime_secs", executorSummary.get_uptime_secs());
-        result.put("transferred", null);
+        result.put(":host", executorSummary.get_host());
+        result.put(":port", executorSummary.get_port());
+        result.put(":uptime_secs", executorSummary.get_uptime_secs());
+        result.put(":transferred", null);
         if (executorSummary.is_set_stats()) {
-            result.put("transferred", sanitizeTransferredStats(executorSummary.get_stats().get_transferred()));
+            result.put(":transferred", sanitizeTransferredStats(executorSummary.get_stats().get_transferred()));
         }
         return result;
     }
@@ -1366,12 +1366,11 @@ public class UIHelpers {
      * @return getInputMap
      */
     public static Map<String, Object> getInputMap(Map.Entry<GlobalStreamId,Grouping>
entryInput) {
-
         Map<String, Object> result = new HashMap();
-        result.put("component", entryInput.getKey().get_componentId());
-        result.put("stream", entryInput.getKey().get_streamId());
-        result.put("sani-stream", sanitizeStreamName(entryInput.getKey().get_streamId()));
-        result.put("grouping", entryInput.getValue().getSetField().getFieldName());
+        result.put(":component", entryInput.getKey().get_componentId());
+        result.put(":stream", entryInput.getKey().get_streamId());
+        result.put(":sani-stream", sanitizeStreamName(entryInput.getKey().get_streamId()));
+        result.put(":grouping", entryInput.getValue().getSetField().getFieldName());
         return result;
     }
 
@@ -1402,17 +1401,17 @@ public class UIHelpers {
             String spoutComponentId = spoutSpecMapEntry.getKey();
             if (spoutSummaries.containsKey(spoutComponentId)) {
                 Map<String, Object> spoutData = new HashMap();
-                spoutData.put("type", "spout");
-                spoutData.put("capacity", 0);
+                spoutData.put(":type", "spout");
+                spoutData.put(":capacity", 0);
                 Map<String, Map> spoutStreamsStats = StatsUtil.spoutStreamsStats(spoutSummaries.get(spoutComponentId),
true);
-                spoutData.put("latency", spoutStreamsStats.get("complete-latencies").get(window));
-                spoutData.put("transferred", spoutStreamsStats.get("transferred").get(window));
-                spoutData.put("stats", spoutSummaries.get(
+                spoutData.put(":latency", spoutStreamsStats.get("complete-latencies").get(window));
+                spoutData.put(":transferred", spoutStreamsStats.get("transferred").get(window));
+                spoutData.put(":stats", spoutSummaries.get(
                         spoutComponentId).stream().map(
                                 UIHelpers::getStatMapFromExecutorSummary).collect(Collectors.toList()));
-                spoutData.put("link", UIHelpers.urlFormat("/component.html?id=%s&topology_id=%s",
spoutComponentId, topoId));
+                spoutData.put(":link", UIHelpers.urlFormat("/component.html?id=%s&topology_id=%s",
spoutComponentId, topoId));
 
-                result.put("inputs",
+                spoutData.put(":inputs",
                     spoutSpecMapEntry.getValue().get_common().get_inputs().entrySet().stream().map(
                             UIHelpers::getInputMap).collect(Collectors.toList())
                 );
@@ -1422,19 +1421,19 @@ public class UIHelpers {
 
         for (Map.Entry<String, Bolt> boltEntry : boltSpecs.entrySet()) {
             String boltComponentId = boltEntry.getKey();
-            if (boltSummaries.containsKey(boltComponentId) && (sys || Utils.isSystemId(boltComponentId)))
{
+            if (boltSummaries.containsKey(boltComponentId) && (sys || !Utils.isSystemId(boltComponentId)))
{
                 Map<String, Object> boltMap = new HashMap();
-                boltMap.put("type", "bolt");
-                boltMap.put("capacity", StatsUtil.computeBoltCapacity(boltSummaries.get(boltComponentId)));
+                boltMap.put(":type", "bolt");
+                boltMap.put(":capacity", StatsUtil.computeBoltCapacity(boltSummaries.get(boltComponentId)));
                 Map<String, Map> boltStreamsStats = StatsUtil.boltStreamsStats(boltSummaries.get(boltComponentId),
true);
-                boltMap.put("latency", boltStreamsStats.get("process-latencies").get(window));
-                boltMap.put("transferred", boltStreamsStats.get("transferred").get(window));
-                boltMap.put("stats", boltSummaries.get(
+                boltMap.put(":latency", boltStreamsStats.get("process-latencies").get(window));
+                boltMap.put(":transferred", boltStreamsStats.get("transferred").get(window));
+                boltMap.put(":stats", boltSummaries.get(
                         boltComponentId).stream().map(
                         UIHelpers::getStatMapFromExecutorSummary).collect(Collectors.toList()));
-                boltMap.put("link", UIHelpers.urlFormat("/component.html?id=%s&topology_id=%s",
boltComponentId, topoId));
+                boltMap.put(":link", UIHelpers.urlFormat("/component.html?id=%s&topology_id=%s",
boltComponentId, topoId));
 
-                result.put("inputs",
+                boltMap.put(":inputs",
                         boltEntry.getValue().get_common().get_inputs().entrySet().stream().map(
                                 UIHelpers::getInputMap).collect(Collectors.toList())
                 );


Mime
View raw message