storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [2/6] storm git commit: fixing format and naming conventions
Date Fri, 06 Nov 2015 17:08:11 GMT
fixing format and naming conventions


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

Branch: refs/heads/master
Commit: 3586bc3eb1d98ead97cee996f201e1b90405cb63
Parents: 8501184
Author: Boyang Jerry Peng <jerrypeng@yahoo-inc.com>
Authored: Wed Nov 4 13:07:16 2015 -0600
Committer: Boyang Jerry Peng <jerrypeng@yahoo-inc.com>
Committed: Wed Nov 4 13:45:26 2015 -0600

----------------------------------------------------------------------
 .../src/clj/backtype/storm/daemon/logviewer.clj | 20 +++---
 .../src/clj/backtype/storm/daemon/nimbus.clj    |  1 -
 storm-core/src/clj/backtype/storm/ui/core.clj   | 72 ++++++++++----------
 3 files changed, 46 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/3586bc3e/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
index 5fe2e26..e4d518d 100644
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -45,11 +45,11 @@
 
 (def ^:dynamic *STORM-CONF* (read-storm-config))
 
-(defmeter num:logviewer-log-page-httpRequests)
-(defmeter num:logviewer-daemonlog-page-httpRequests)
-(defmeter num:logviewer-download-log-file-httpRequests)
-(defmeter num:logviewer-download-log-daemon-file-httpRequests)
-(defmeter num:logviewer-list-logs-httpRequests)
+(defmeter logviewer:num-log-page-http-requests)
+(defmeter logviewer:num-daemonlog-page-http-requests)
+(defmeter logviewer:num-download-log-file-http-requests)
+(defmeter logviewer:num-download-log-daemon-file-http-requests)
+(defmeter logviewer:num-list-logs-http-requests)
 
 (defn cleanup-cutoff-age-millis [conf now-millis]
   (- now-millis (* (conf LOGVIEWER-CLEANUP-AGE-MINS) 60 1000)))
@@ -545,7 +545,7 @@ Note that if anything goes wrong, this will throw an Error and exit."
 (defroutes log-routes
   (GET "/log" [:as req & m]
     (try
-      (mark! num:logviewer-log-page-httpRequests)
+      (mark! logviewer:num-log-page-http-requests)
       (let [servlet-request (:servlet-request req)
             log-root (:log-root req)
             user (.getUserName http-creds-handler servlet-request)
@@ -604,7 +604,7 @@ Note that if anything goes wrong, this will throw an Error and exit."
            (resp/status 404)))))
   (GET "/daemonlog" [:as req & m]
     (try
-      (mark! num:logviewer-daemonlog-page-httpRequests)
+      (mark! logviewer:num-daemonlog-page-http-requests)
       (let [servlet-request (:servlet-request req)
             daemonlog-root (:daemonlog-root req)
             user (.getUserName http-creds-handler servlet-request)
@@ -618,7 +618,7 @@ Note that if anything goes wrong, this will throw an Error and exit."
         (ring-response-from-exception ex))))
   (GET "/download/:file" [:as {:keys [servlet-request servlet-response log-root]} file &
m]
     (try
-      (mark! num:logviewer-download-log-file-httpRequests)
+      (mark! logviewer:num-download-log-file-http-requests)
       (let [user (.getUserName http-creds-handler servlet-request)]
         (download-log-file file servlet-request servlet-response user log-root))
       (catch InvalidRequestException ex
@@ -626,7 +626,7 @@ Note that if anything goes wrong, this will throw an Error and exit."
         (ring-response-from-exception ex))))
   (GET "/daemondownload/:file" [:as {:keys [servlet-request servlet-response daemonlog-root]}
file & m]
     (try
-      (mark! num:logviewer-download-log-daemon-file-httpRequests)
+      (mark! logviewer:num-download-log-daemon-file-http-requests)
       (let [user (.getUserName http-creds-handler servlet-request)]
         (download-log-file file servlet-request servlet-response user daemonlog-root))
       (catch InvalidRequestException ex
@@ -634,7 +634,7 @@ Note that if anything goes wrong, this will throw an Error and exit."
         (ring-response-from-exception ex))))
   (GET "/listLogs" [:as req & m]
     (try
-      (mark! num:logviewer-list-logs-httpRequests)
+      (mark! logviewer:num-list-logs-http-requests)
       (let [servlet-request (:servlet-request req)
             user (.getUserName http-creds-handler servlet-request)]
         (list-log-files user

http://git-wip-us.apache.org/repos/asf/storm/blob/3586bc3e/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 edb3d4c..43f1858 100644
--- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
@@ -56,7 +56,6 @@
   (:gen-class
     :methods [^{:static true} [launch [backtype.storm.scheduler.INimbus] void]]))
 
-
 (defmeter nimbus:num-submitTopologyWithOpts-calls)
 (defmeter nimbus:num-submitTopology-calls)
 (defmeter nimbus:num-killTopologyWithOpts-calls)

http://git-wip-us.apache.org/repos/asf/storm/blob/3586bc3e/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 7fa367b..ecf9b2c 100644
--- a/storm-core/src/clj/backtype/storm/ui/core.clj
+++ b/storm-core/src/clj/backtype/storm/ui/core.clj
@@ -57,24 +57,24 @@
 (def ^:dynamic *UI-IMPERSONATION-HANDLER* (mk-authorization-handler (*STORM-CONF* NIMBUS-IMPERSONATION-AUTHORIZER)
*STORM-CONF*))
 (def http-creds-handler (AuthUtils/GetUiHttpCredentialsPlugin *STORM-CONF*))
 
-(defmeter ui:num-cluster-configuration-httpRequests)
-(defmeter ui:num-cluster-summary-httpRequests)
-(defmeter ui:num-nimbus-summary-httpRequests)
-(defmeter ui:num-supervisor-summary-httpRequests)
-(defmeter ui:num-all-topologies-summary-httpRequests)
-(defmeter ui:num-topology-page-httpRequests)
-(defmeter ui:num-build-visualization-httpRequests)
-(defmeter ui:num-mk-visualization-data-httpRequests)
-(defmeter ui:num-component-page-httpRequests)
-(defmeter ui:num-log-config-httpRequests)
-(defmeter ui:num-activate-topology-httpRequests)
-(defmeter ui:num-deactivate-topology-httpRequests)
-(defmeter ui:num-debug-topology-httpRequests)
-(defmeter ui:num-component-op-response-httpRequests)
-(defmeter ui:num-topology-op-response-httpRequests)
-(defmeter ui:num-topology-op-response-httpRequests)
-(defmeter ui:num-topology-op-response-httpRequests)
-(defmeter ui:num-main-page-httpRequests)
+(defmeter ui:num-cluster-configuration-http-requests)
+(defmeter ui:num-cluster-summary-http-requests)
+(defmeter ui:num-nimbus-summary-http-requests)
+(defmeter ui:num-supervisor-summary-http-requests)
+(defmeter ui:num-all-topologies-summary-http-requests)
+(defmeter ui:num-topology-page-http-requests)
+(defmeter ui:num-build-visualization-http-requests)
+(defmeter ui:num-mk-visualization-data-http-requests)
+(defmeter ui:num-component-page-http-requests)
+(defmeter ui:num-log-config-http-requests)
+(defmeter ui:num-activate-topology-http-requests)
+(defmeter ui:num-deactivate-topology-http-requests)
+(defmeter ui:num-debug-topology-http-requests)
+(defmeter ui:num-component-op-response-http-requests)
+(defmeter ui:num-topology-op-response-http-requests)
+(defmeter ui:num-topology-op-response-http-requests)
+(defmeter ui:num-topology-op-response-http-requests)
+(defmeter ui:num-main-page-http-requests)
 
 (defn assert-authorized-user
   ([op]
@@ -887,48 +887,48 @@
 
 (defroutes main-routes
   (GET "/api/v1/cluster/configuration" [& m]
-    (mark! ui:num-cluster-configuration-httpRequests)
+    (mark! ui:num-cluster-configuration-http-requests)
     (json-response (cluster-configuration)
                    (:callback m) :serialize-fn identity))
   (GET "/api/v1/cluster/summary" [:as {:keys [cookies servlet-request]} & m]
-    (mark! ui:num-cluster-summary-httpRequests)
+    (mark! ui:num-cluster-summary-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getClusterInfo")
     (let [user (get-user-name servlet-request)]
       (json-response (cluster-summary user) (:callback m))))
   (GET "/api/v1/nimbus/summary" [:as {:keys [cookies servlet-request]} & m]
-    (mark! ui:num-nimbus-summary-httpRequests)
+    (mark! ui:num-nimbus-summary-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getClusterInfo")
     (json-response (nimbus-summary) (:callback m)))
   (GET "/api/v1/supervisor/summary" [:as {:keys [cookies servlet-request]} & m]
-    (mark! ui:num-supervisor-summary-httpRequests)
+    (mark! ui:num-supervisor-summary-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getClusterInfo")
     (json-response (supervisor-summary) (:callback m)))
   (GET "/api/v1/topology/summary" [:as {:keys [cookies servlet-request]} & m]
-    (mark! ui:num-all-topologies-summary-httpRequests)
+    (mark! ui:num-all-topologies-summary-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getClusterInfo")
     (json-response (all-topologies-summary) (:callback m)))
   (GET "/api/v1/topology/:id" [:as {:keys [cookies servlet-request scheme]} id & m]
-    (mark! ui:num-topology-page-httpRequests)
+    (mark! ui:num-topology-page-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getTopology" (topology-config id))
     (let [user (get-user-name servlet-request)]
       (json-response (topology-page id (:window m) (check-include-sys? (:sys m)) user (=
scheme :https)) (:callback m))))
   (GET "/api/v1/topology/:id/visualization-init" [:as {:keys [cookies servlet-request]} id
& m]
-    (mark! ui:num-build-visualization-httpRequests)
+    (mark! ui:num-build-visualization-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getTopology" (topology-config id))
     (json-response (build-visualization id (:window m) (check-include-sys? (:sys m))) (:callback
m)))
   (GET "/api/v1/topology/:id/visualization" [:as {:keys [cookies servlet-request]} id &
m]
-    (mark! ui:num-mk-visualization-data-httpRequests)
+    (mark! ui:num-mk-visualization-data-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getTopology" (topology-config id))
     (json-response (mk-visualization-data id (:window m) (check-include-sys? (:sys m))) (:callback
m)))
   (GET "/api/v1/topology/:id/component/:component" [:as {:keys [cookies servlet-request scheme]}
id component & m]
-    (mark! ui:num-component-page-httpRequests)
+    (mark! ui:num-component-page-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getTopology" (topology-config id))
     (let [user (get-user-name servlet-request)]
@@ -936,12 +936,12 @@
           (component-page id component (:window m) (check-include-sys? (:sys m)) user (=
scheme :https))
           (:callback m))))
   (GET "/api/v1/topology/:id/logconfig" [:as {:keys [cookies servlet-request]} id & m]
-    (mark! ui:num-log-config-httpRequests)
+    (mark! ui:num-log-config-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "getTopology" (topology-config id))
        (json-response (log-config id) (:callback m)))
   (POST "/api/v1/topology/:id/activate" [:as {:keys [cookies servlet-request]} id & m]
-    (mark! ui:num-activate-topology-httpRequests)
+    (mark! ui:num-activate-topology-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "activate" (topology-config id))
     (thrift/with-configured-nimbus-connection nimbus
@@ -954,7 +954,7 @@
         (log-message "Activating topology '" name "'")))
     (json-response (topology-op-response id "activate") (m "callback")))
   (POST "/api/v1/topology/:id/deactivate" [:as {:keys [cookies servlet-request]} id &
m]
-    (mark! ui:num-deactivate-topology-httpRequests)
+    (mark! ui:num-deactivate-topology-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "deactivate" (topology-config id))
     (thrift/with-configured-nimbus-connection nimbus
@@ -967,7 +967,7 @@
         (log-message "Deactivating topology '" name "'")))
     (json-response (topology-op-response id "deactivate") (m "callback")))
   (POST "/api/v1/topology/:id/debug/:action/:spct" [:as {:keys [cookies servlet-request]}
id action spct & m]
-    (mark! ui:num-debug-topology-httpRequests)
+    (mark! ui:num-debug-topology-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "debug" (topology-config id))
     (thrift/with-configured-nimbus-connection nimbus
@@ -981,7 +981,7 @@
         (log-message "Debug topology [" name "] action [" action "] sampling pct [" spct
"]")))
      (json-response (topology-op-response id (str "debug/" action)) (m "callback")))
   (POST "/api/v1/topology/:id/component/:component/debug/:action/:spct" [:as {:keys [cookies
servlet-request]} id component action spct & m]
-    (mark! ui:num-component-op-response-httpRequests)
+    (mark! ui:num-component-op-response-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "debug" (topology-config id))
     (thrift/with-configured-nimbus-connection nimbus
@@ -995,7 +995,7 @@
         (log-message "Debug topology [" name "] component [" component "] action [" action
"] sampling pct [" spct "]")))
     (json-response (component-op-response id component (str "/debug/" action)) (m "callback")))
   (POST "/api/v1/topology/:id/rebalance/:wait-time" [:as {:keys [cookies servlet-request]}
id wait-time & m]
-    (mark! ui:num-topology-op-response-httpRequests)
+    (mark! ui:num-topology-op-response-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "rebalance" (topology-config id))
     (thrift/with-configured-nimbus-connection nimbus
@@ -1016,7 +1016,7 @@
         (log-message "Rebalancing topology '" name "' with wait time: " wait-time " secs")))
     (json-response (topology-op-response id "rebalance") (m "callback")))
   (POST "/api/v1/topology/:id/kill/:wait-time" [:as {:keys [cookies servlet-request]} id
wait-time & m]
-    (mark! ui:num-topology-op-response-httpRequests)
+    (mark! ui:num-topology-op-response-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "killTopology" (topology-config id))
     (thrift/with-configured-nimbus-connection nimbus
@@ -1031,7 +1031,7 @@
         (log-message "Killing topology '" name "' with wait time: " wait-time " secs")))
     (json-response (topology-op-response id "kill") (m "callback")))
   (POST "/api/v1/topology/:id/logconfig" [:as {:keys [cookies servlet-request]} id namedLoggerLevels
& m]
-    (mark! ui:num-topology-op-response-httpRequests)
+    (mark! ui:num-topology-op-response-http-requests)
     (populate-context! servlet-request)
     (assert-authorized-user "setLogConfig" (topology-config id))
     (thrift/with-configured-nimbus-connection
@@ -1180,7 +1180,7 @@
                           (m "callback")))))
   
   (GET "/" [:as {cookies :cookies}]
-    (mark! ui:num-main-page-httpRequests)
+    (mark! ui:num-main-page-http-requests)
     (resp/redirect "/index.html"))
   (route/resources "/")
   (route/not-found "Page not found"))


Mime
View raw message