storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [2/7] git commit: Fixing review comments
Date Mon, 23 Jun 2014 14:29:08 GMT
Fixing review comments


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

Branch: refs/heads/master
Commit: ff2d1a198a0da10c8a0bf21de3410e38f9db8773
Parents: 550a259
Author: Kishor Patil <kpatil@yahoo-inc.com>
Authored: Fri Jun 20 19:53:12 2014 +0000
Committer: Kishor Patil <kpatil@yahoo-inc.com>
Committed: Fri Jun 20 19:53:12 2014 +0000

----------------------------------------------------------------------
 .../src/clj/backtype/storm/daemon/nimbus.clj    |  7 ++--
 storm-core/src/clj/backtype/storm/ui/core.clj   | 40 +++++++++-----------
 storm-core/src/ui/public/component.html         |  8 ++--
 .../templates/component-page-template.html      |  2 +-
 4 files changed, 26 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/ff2d1a19/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
index 1351a38..398ffc0 100644
--- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
@@ -857,10 +857,9 @@
 
 (defn- get-errors [storm-cluster-state storm-id component-id]
   (->> (.errors storm-cluster-state storm-id component-id)
-       (map #(let [error-info (ErrorInfo. (:error %) (:time-secs %))
-                   _ (.set_host error-info (:host %))
-                   _ (.set_port error-info (:port %))]
-                   error-info))))
+       (map #(doto error-info (ErrorInfo. (:error %) (:time-secs %))
+                   (.set_host error-info (:host %))
+                   (.set_port error-info (:port %))))))
 
 (defn- thriftify-executor-id [[first-task-id last-task-id]]
   (ExecutorInfo. (int first-task-id) (int last-task-id)))

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/ff2d1a19/storm-core/src/clj/backtype/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/ui/core.clj b/storm-core/src/clj/backtype/storm/ui/core.clj
index a2366f3..55ec4b8 100644
--- a/storm-core/src/clj/backtype/storm/ui/core.clj
+++ b/storm-core/src/clj/backtype/storm/ui/core.clj
@@ -249,8 +249,7 @@
                    (sort-by #(.get_error_time_secs ^ErrorInfo %))
                    reverse
                    first)]
-    error
-  ))
+    error))
 
 (defn component-task-summs
   [^TopologyInfo summ topology id]
@@ -290,29 +289,30 @@
        (map nil-to-zero)
        (apply max)))
 
-(defn get-error-span [error]
+(defn get-error-span 
+  [error]
   (if (and error (< (time-delta (.get_error_time_secs ^ErrorInfo error))
                     (* 60 30)))
     {:class "red"}
-    {}
-    ))
+    {}))
 
-(defn get-error-data [error]
+(defn get-error-data 
+  [error]
   (if error
     (error-subset (.get_error ^ErrorInfo error))
-    ""
-    ))
-(defn get-error-port [error error-host top-id]
+    ""))
+
+(defn get-error-port
+  [error error-host top-id]
   (if error
     (.get_port ^ErrorInfo error)
-    ""
-    ))
+    ""))
 
-(defn get-error-host [error]
+(defn get-error-host
+  [error]
   (if error
     (.get_host ^ErrorInfo error)
-    ""
-    ))
+    ""))
 
 (defn spout-streams-stats
   [summs include-sys?]
@@ -550,8 +550,7 @@
                       stats-seq include-sys?))
               last-error (most-recent-error (get errors id))
               error-host (get-error-host last-error)
-              error-port (get-error-port last-error error-host top-id)
-              ]]
+              error-port (get-error-port last-error error-host top-id) ]]
     {"spoutId" id
      "executors" (count summs)
      "tasks" (sum-tasks summs)
@@ -563,8 +562,7 @@
      "errorHost" error-host
      "errorPort" error-port
      "errorWorkerLogLink" (worker-log-link error-host error-port)
-     "lastError" (get-error-data last-error)
-      }))
+     "lastError" (get-error-data last-error) }))
 
 (defn bolt-comp [top-id summ-map errors window include-sys?]
   (for [[id summs] summ-map
@@ -574,8 +572,7 @@
                       stats-seq include-sys?))
               last-error (most-recent-error (get errors id))
               error-host (get-error-host last-error)
-              error-port (get-error-port last-error error-host top-id)
-              ]]
+              error-port (get-error-port last-error error-host top-id) ]]
     {"boltId" id
      "executors" (count summs)
      "tasks" (sum-tasks summs)
@@ -590,8 +587,7 @@
      "errorHost" error-host
      "errorPort" error-port
      "errorWorkerLogLink" (worker-log-link error-host error-port)
-     "lastError" (get-error-data last-error)
-     }))
+     "lastError" (get-error-data last-error) }))
 
 (defn topology-summary [^TopologyInfo summ]
   (let [executors (.get_executors summ)

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/ff2d1a19/storm-core/src/ui/public/component.html
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/component.html b/storm-core/src/ui/public/component.html
index 823f8a3..aae0245 100644
--- a/storm-core/src/ui/public/component.html
+++ b/storm-core/src/ui/public/component.html
@@ -70,10 +70,6 @@ $(document).ready(function() {
         var executorStats = $("#component-executor-stats");
         var componentErrors = $("#component-errors");
         $.get("/templates/component-page-template.html", function(template) {
-            componentErrors.append(Mustache.render($(template).filter("#component-errors-template").html(),response));
-            if(response["componentErrors"].length > 0) {
-                $("#component-errors-table").tablesorter({ sortList: [[0,0]], headers: {1:
{ sorter: "stormtimestr"}}});
-            }
             componentSummary.append(Mustache.render($(template).filter("#component-summary-template").html(),response));
             if(response["componentType"] == "spout") {
                 componentStatsDetail.append(Mustache.render($(template).filter("#spout-stats-detail-template").html(),response));
@@ -96,6 +92,10 @@ $(document).ready(function() {
                     $("#bolt-executor-table").tablesorter({ sortList: [[0,0]], headers: {}});
                 }
             }
+            componentErrors.append(Mustache.render($(template).filter("#component-errors-template").html(),response));
+            if(response["componentErrors"].length > 0) {
+                $("#component-errors-table").tablesorter({ sortList: [[0,0]], headers: {1:
{ sorter: "stormtimestr"}}});
+            }
         });
     });
 });

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/ff2d1a19/storm-core/src/ui/public/templates/component-page-template.html
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/templates/component-page-template.html b/storm-core/src/ui/public/templates/component-page-template.html
index f326067..0c0bd04 100644
--- a/storm-core/src/ui/public/templates/component-page-template.html
+++ b/storm-core/src/ui/public/templates/component-page-template.html
@@ -156,7 +156,7 @@
 </script>
 <script id="component-errors-template" type="text/html">
 <h2>Errors</h2>
-<table class="zebra-striped" id="component-errors-table"><thead><tr><th>Time</th><th>Error
Host</th>th>Error Port</th><th>Error</th></tr></thead>
+<table class="zebra-striped" id="component-errors-table"><thead><tr><th>Time</th><th>Error
Host</th><th>Error Port</th><th>Error</th></tr></thead>
 <tbody>
 {{#componentErrors}}
 <tr>


Mime
View raw message