rzo1 commented on code in PR #3633:
URL: https://github.com/apache/storm/pull/3633#discussion_r1552209393


##########
storm-server/src/main/java/org/apache/storm/utils/ServerUtils.java:
##########
@@ -708,9 +708,24 @@ public static double 
getEstimatedTotalHeapMemoryRequiredByTopo(Map<String, Objec
             double memoryRequirement = entry.getValue().getOnHeapMemoryMb();
             totalMemoryRequired += memoryRequirement * parallelism;
         }
+
+        double ackerMem = getTotalAckerExecutorMemoryUsageForTopo(topology, 
topoConf);
+        totalMemoryRequired += ackerMem;
+
         return totalMemoryRequired;
     }
 
+    private static double getTotalAckerExecutorMemoryUsageForTopo(
+            StormTopology topology, Map<String, Object> topologyConf)
+            throws InvalidTopologyException {
+        topology = StormCommon.systemTopology(topologyConf, topology);
+        Map<String, NormalizedResourceRequest> boltResources = 
ResourceUtils.getBoltsResources(topology, topologyConf);
+        NormalizedResourceRequest entry = 
boltResources.get(Acker.ACKER_COMPONENT_ID);
+        Map<String, Integer> componentParallelism = 
getComponentParallelism(topologyConf, topology);
+        int parallelism = 
componentParallelism.getOrDefault(Acker.ACKER_COMPONENT_ID, 1);
+        return entry.getTotalMemoryMb() * parallelism;

Review Comment:
   is `entry`guaranteed to be not `null` since it comes out of a map, so maybe 
`getOrDefault(...)` earlier?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@storm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to