Github user jerrypeng commented on a diff in the pull request:
https://github.com/apache/storm/pull/746#discussion_r40732961
--- Diff: storm-core/src/jvm/backtype/storm/StormSubmitter.java ---
@@ -442,4 +444,36 @@ public static String submitJar(Map conf, String
localJar, ProgressListener liste
*/
public void onCompleted(String srcFile, String targetFile, long
totalBytes);
}
+
+
+ private static void validateConfs(Map stormConf, StormTopology
topology) throws IllegalArgumentException {
+ LOG.info("Validating storm Confs...");
+ double largestMemReq = getMaxExecutorMemoryUsageForTopo(topology,
stormConf);
+ Double topologyWorkerMaxHeapSize =
Utils.getDouble(stormConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB));
+ if(topologyWorkerMaxHeapSize < largestMemReq) {
+ throw new IllegalArgumentException("Topology will not be able
to be successfully scheduled: Config TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB="
+
+Utils.getDouble(stormConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB)) + " <
"
+ + largestMemReq + " (Largest memory
requirement of a component in the topology). Perhaps set
TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB to a larger amount");
+ }
+ }
+
+
+ private static double getMaxExecutorMemoryUsageForTopo(StormTopology
topology, Map topologyConf) {
+ double largestMemoryOperator = 0.0;
+ for(Map<String, Double> entry :
backtype.storm.scheduler.resource.Utils.getBoltsResources(topology,
topologyConf).values()) {
--- End diff --
rename
---
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 [email protected] or file a JIRA ticket
with INFRA.
---