storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kishorvpa...@apache.org
Subject [2/3] storm git commit: Avoid possible illegal Argument
Date Thu, 08 Nov 2018 22:44:07 GMT
Avoid possible illegal Argument


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

Branch: refs/heads/master
Commit: 2ba69e2e4e56bc8207c629d64b1abbe22dccc457
Parents: 8288d41
Author: Kishor Patil <kpatil@oath.com>
Authored: Wed Nov 7 11:35:35 2018 -0500
Committer: Kishor Patil <kpatil@oath.com>
Committed: Wed Nov 7 11:35:35 2018 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/storm/utils/ServerUtils.java     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/2ba69e2e/storm-server/src/main/java/org/apache/storm/utils/ServerUtils.java
----------------------------------------------------------------------
diff --git a/storm-server/src/main/java/org/apache/storm/utils/ServerUtils.java b/storm-server/src/main/java/org/apache/storm/utils/ServerUtils.java
index 6f65bf7..615aead 100644
--- a/storm-server/src/main/java/org/apache/storm/utils/ServerUtils.java
+++ b/storm-server/src/main/java/org/apache/storm/utils/ServerUtils.java
@@ -691,10 +691,9 @@ public class ServerUtils {
 
     public static int getEstimatedWorkerCountForRASTopo(Map<String, Object> topoConf,
StormTopology topology)
         throws InvalidTopologyException {
-        Double defaultWorkerMaxHeap = ObjectReader.getDouble(topoConf.get(Config.WORKER_HEAP_MEMORY_MB));
-        Double topologyWorkerMaxHeap = ObjectReader.getDouble(topoConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB));
-        Double maxHeapSize = topologyWorkerMaxHeap != null && topologyWorkerMaxHeap
!= 0 ? topologyWorkerMaxHeap : defaultWorkerMaxHeap;
-        return (int) Math.ceil(getEstimatedTotalHeapMemoryRequiredByTopo(topoConf, topology)
/ maxHeapSize);
+        Double defaultWorkerMaxHeap = ObjectReader.getDouble(topoConf.get(Config.WORKER_HEAP_MEMORY_MB),
768d);
+        Double topologyWorkerMaxHeap = ObjectReader.getDouble(topoConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB),
defaultWorkerMaxHeap);
+        return (int) Math.ceil(getEstimatedTotalHeapMemoryRequiredByTopo(topoConf, topology)
/ topologyWorkerMaxHeap);
     }
 
     public static double getEstimatedTotalHeapMemoryRequiredByTopo(Map<String, Object>
topoConf, StormTopology topology)


Mime
View raw message