storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kishorvpa...@apache.org
Subject [1/3] storm git commit: Fix RAS worker count estimation
Date Thu, 08 Nov 2018 22:44:06 GMT
Repository: storm
Updated Branches:
  refs/heads/master 19fbfb9ac -> 98ed0a815


Fix RAS worker count estimation


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

Branch: refs/heads/master
Commit: 8288d41b313126ce7a9da7b548801a58da98b7ae
Parents: 19fbfb9
Author: Kishor Patil <kpatil@oath.com>
Authored: Tue Nov 6 16:58:31 2018 -0500
Committer: Kishor Patil <kpatil@oath.com>
Committed: Tue Nov 6 16:58:31 2018 -0500

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


http://git-wip-us.apache.org/repos/asf/storm/blob/8288d41b/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 37d9c67..6f65bf7 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,8 +691,10 @@ public class ServerUtils {
 
     public static int getEstimatedWorkerCountForRASTopo(Map<String, Object> topoConf,
StormTopology topology)
         throws InvalidTopologyException {
-        return (int) Math.ceil(getEstimatedTotalHeapMemoryRequiredByTopo(topoConf, topology)
/
-                               ObjectReader.getDouble(topoConf.get(Config.WORKER_HEAP_MEMORY_MB)));
+        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);
     }
 
     public static double getEstimatedTotalHeapMemoryRequiredByTopo(Map<String, Object>
topoConf, StormTopology topology)


Mime
View raw message