Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/746#discussion_r40730552
  
    --- 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 --
    
    Can we rename backtype.storm.scheduler.resource.Utils to be something like 
ResourceUtils instead.  Just so there is no conflict with imports.  I think it 
will make the code cleaner.


---
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.
---

Reply via email to