You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2015/11/20 23:26:30 UTC

[05/15] storm git commit: Using config to decide whether to show resource rather than hard-coded scheduler

Using config to decide whether to show resource rather than hard-coded scheduler


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

Branch: refs/heads/master
Commit: 2d993c515ecde059ad986bf2c3a77cf463d75b74
Parents: 6b12a0b
Author: zhuol <zh...@yahoo-inc.com>
Authored: Fri Nov 13 13:29:50 2015 -0600
Committer: zhuol <zh...@yahoo-inc.com>
Committed: Thu Nov 19 12:39:25 2015 -0600

----------------------------------------------------------------------
 conf/defaults.yaml                            | 2 ++
 storm-core/src/jvm/backtype/storm/Config.java | 9 +++++++++
 storm-core/src/ui/public/index.html           | 8 ++++----
 storm-core/src/ui/public/topology.html        | 4 ++--
 4 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/2d993c51/conf/defaults.yaml
----------------------------------------------------------------------
diff --git a/conf/defaults.yaml b/conf/defaults.yaml
index b498571..af5daa1 100644
--- a/conf/defaults.yaml
+++ b/conf/defaults.yaml
@@ -74,6 +74,8 @@ topology.max.replication.wait.time.sec: 60
 nimbus.credential.renewers.freq.secs: 600
 nimbus.impersonation.authorizer: "backtype.storm.security.auth.authorizer.ImpersonationAuthorizer"
 
+scheduler.resource.display: false
+
 ### ui.* configs are for the master
 ui.host: 0.0.0.0
 ui.port: 8080

http://git-wip-us.apache.org/repos/asf/storm/blob/2d993c51/storm-core/src/jvm/backtype/storm/Config.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/Config.java b/storm-core/src/jvm/backtype/storm/Config.java
index 2830f2f..852757d 100644
--- a/storm-core/src/jvm/backtype/storm/Config.java
+++ b/storm-core/src/jvm/backtype/storm/Config.java
@@ -174,6 +174,15 @@ public class Config extends HashMap<String, Object> {
     public static final String STORM_SCHEDULER = "storm.scheduler";
 
     /**
+     * Whether we want to display all the resource capacity and scheduled usage on the UI page.
+     * We suggest to have this variable set if you are using any kind of resource-related scheduler.
+     *
+     * If this is not set, we will not display resource capacity and usage on the UI.
+     */
+    @isBoolean
+    public static final String SCHEDULER_RESOURCE_DISPLAY = "scheduler.resource.display";
+
+    /**
      * The mode this Storm cluster is running in. Either "distributed" or "local".
      */
     @isString

http://git-wip-us.apache.org/repos/asf/storm/blob/2d993c51/storm-core/src/ui/public/index.html
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/index.html b/storm-core/src/ui/public/index.html
index 6e52923..d113e30 100644
--- a/storm-core/src/ui/public/index.html
+++ b/storm-core/src/ui/public/index.html
@@ -144,8 +144,8 @@ $(document).ready(function() {
           });
           $('#topology-summary [data-toggle="tooltip"]').tooltip();
           $.getJSON("/api/v1/cluster/configuration", function(json){
-              var scheduler = json["storm.scheduler"];
-              if (scheduler != "backtype.storm.scheduler.resource.ResourceAwareScheduler"){
+              var displayResource = json["scheduler.display.resource"];
+              if (!displayResource){
                   $('#topology-summary td:nth-child(9),#topology-summary th:nth-child(9)').hide();
                   $('#topology-summary td:nth-child(10),#topology-summary th:nth-child(10)').hide();
               }
@@ -164,8 +164,8 @@ $(document).ready(function() {
           });
           $('#supervisor-summary [data-toggle="tooltip"]').tooltip();
           $.getJSON("/api/v1/cluster/configuration", function(json){
-              var scheduler = json["storm.scheduler"];
-              if (scheduler != "backtype.storm.scheduler.resource.ResourceAwareScheduler"){
+              var displayResource = json["scheduler.display.resource"];
+              if (!displayResource){
                   $('#supervisor-summary td:nth-child(6),#supervisor-summary th:nth-child(6)').hide();
                   $('#supervisor-summary td:nth-child(7),#supervisor-summary th:nth-child(7)').hide();
                   $('#supervisor-summary td:nth-child(8),#supervisor-summary th:nth-child(8)').hide();

http://git-wip-us.apache.org/repos/asf/storm/blob/2d993c51/storm-core/src/ui/public/topology.html
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/topology.html b/storm-core/src/ui/public/topology.html
index b8dd1f9..b062196 100644
--- a/storm-core/src/ui/public/topology.html
+++ b/storm-core/src/ui/public/topology.html
@@ -294,8 +294,8 @@ $(document).ready(function() {
             topologySummary.append(Mustache.render($(template).filter("#topology-summary-template").html(),response));
             topologyResources.append(Mustache.render($(template).filter("#topology-resources-template").html(),response));
             $.getJSON("/api/v1/cluster/configuration", function(json){
-              var scheduler = json["storm.scheduler"];
-              if (scheduler != "backtype.storm.scheduler.resource.ResourceAwareScheduler"){
+              var displayResource = json["scheduler.resource.display"];
+              if (!displayResource){
                   $('#topology-resources-header').hide();
                   $('#topology-resources').hide();
               }