[GitHub] storm pull request #1699: STORM-2109: Treat Supervisor CPU/MEMORY Configs as...

2016-09-25 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/storm/pull/1699


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request #1699: STORM-2109: Treat Supervisor CPU/MEMORY Configs as...

2016-09-23 Thread revans2
Github user revans2 commented on a diff in the pull request:

https://github.com/apache/storm/pull/1699#discussion_r80282664
  
--- Diff: 
storm-core/src/jvm/org/apache/storm/daemon/supervisor/timer/SupervisorHeartbeat.java
 ---
@@ -72,10 +72,10 @@ private SupervisorInfo buildSupervisorInfo(Map conf, Supervisor
 
 private Map mkSupervisorCapacities(Map conf) {
 Map ret = new HashMap();
-Double mem = (double) 
(conf.get(Config.SUPERVISOR_MEMORY_CAPACITY_MB));
-ret.put(Config.SUPERVISOR_MEMORY_CAPACITY_MB, mem);
-Double cpu = (double) (conf.get(Config.SUPERVISOR_CPU_CAPACITY));
-ret.put(Config.SUPERVISOR_CPU_CAPACITY, cpu);
+Number mem = (Number) 
(conf.get(Config.SUPERVISOR_MEMORY_CAPACITY_MB));
+ret.put(Config.SUPERVISOR_MEMORY_CAPACITY_MB, mem.doubleValue());
+Number cpu = (Number) (conf.get(Config.SUPERVISOR_CPU_CAPACITY));
--- End diff --

The NPE should never happen if defaults.yaml is configured correctly, but I 
will still make the change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request #1699: STORM-2109: Treat Supervisor CPU/MEMORY Configs as...

2016-09-22 Thread HeartSaVioR
Github user HeartSaVioR commented on a diff in the pull request:

https://github.com/apache/storm/pull/1699#discussion_r80074819
  
--- Diff: 
storm-core/src/jvm/org/apache/storm/daemon/supervisor/timer/SupervisorHeartbeat.java
 ---
@@ -72,10 +72,10 @@ private SupervisorInfo buildSupervisorInfo(Map conf, Supervisor
 
 private Map mkSupervisorCapacities(Map conf) {
 Map ret = new HashMap();
-Double mem = (double) 
(conf.get(Config.SUPERVISOR_MEMORY_CAPACITY_MB));
-ret.put(Config.SUPERVISOR_MEMORY_CAPACITY_MB, mem);
-Double cpu = (double) (conf.get(Config.SUPERVISOR_CPU_CAPACITY));
-ret.put(Config.SUPERVISOR_CPU_CAPACITY, cpu);
+Number mem = (Number) 
(conf.get(Config.SUPERVISOR_MEMORY_CAPACITY_MB));
+ret.put(Config.SUPERVISOR_MEMORY_CAPACITY_MB, mem.doubleValue());
+Number cpu = (Number) (conf.get(Config.SUPERVISOR_CPU_CAPACITY));
--- End diff --

Good point. Utils.getDouble() with default value would be safer.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request #1699: STORM-2109: Treat Supervisor CPU/MEMORY Configs as...

2016-09-22 Thread kishorvpatil
Github user kishorvpatil commented on a diff in the pull request:

https://github.com/apache/storm/pull/1699#discussion_r79851428
  
--- Diff: 
storm-core/src/jvm/org/apache/storm/daemon/supervisor/timer/SupervisorHeartbeat.java
 ---
@@ -72,10 +72,10 @@ private SupervisorInfo buildSupervisorInfo(Map conf, Supervisor
 
 private Map mkSupervisorCapacities(Map conf) {
 Map ret = new HashMap();
-Double mem = (double) 
(conf.get(Config.SUPERVISOR_MEMORY_CAPACITY_MB));
-ret.put(Config.SUPERVISOR_MEMORY_CAPACITY_MB, mem);
-Double cpu = (double) (conf.get(Config.SUPERVISOR_CPU_CAPACITY));
-ret.put(Config.SUPERVISOR_CPU_CAPACITY, cpu);
+Number mem = (Number) 
(conf.get(Config.SUPERVISOR_MEMORY_CAPACITY_MB));
+ret.put(Config.SUPERVISOR_MEMORY_CAPACITY_MB, mem.doubleValue());
+Number cpu = (Number) (conf.get(Config.SUPERVISOR_CPU_CAPACITY));
--- End diff --

Possibility of NPE here. Can we use utils method to do this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request #1699: STORM-2109: Treat Supervisor CPU/MEMORY Configs as...

2016-09-21 Thread revans2
GitHub user revans2 opened a pull request:

https://github.com/apache/storm/pull/1699

STORM-2109: Treat Supervisor CPU/MEMORY Configs as Numbers



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/revans2/incubator-storm STORM-2109

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/storm/pull/1699.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1699


commit 8fe28a4ad86d1217e15cc67fc5a9577f3b477f0e
Author: Robert (Bobby) Evans 
Date:   2016-09-21T14:41:15Z

STORM-2109: Treat Supervisor CPU/MEMORY Configs as Numbers




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---