Ethanlm commented on a change in pull request #3244: [STORM-3600] Add caching in Cluster.calculateSharedOffHeapNodeMemory URL: https://github.com/apache/storm/pull/3244#discussion_r406508374
########## File path: storm-server/src/main/java/org/apache/storm/scheduler/Cluster.java ########## @@ -709,6 +720,33 @@ public void assign(SchedulerAssignment assignment, boolean ignoreSingleException } } + /** + * Initialize the flag to true if specified topology uses SharedOffHeapNodeMemory, false otherwise. + * + * @param td TopologyDetails to examine + */ + private void initializeTopoSharedOffHeapNodeMemoryFlag(TopologyDetails td) { + String topoId = td.getId(); + topoSharedOffHeapMemoryNodeFlag.put(topoId, false); + StormTopology topology = td.getTopology(); + if (topology == null) { + return; // accomodate multitenant_scheduler_test.clj + } + if (topology.is_set_component_to_shared_memory()) { Review comment: I agree with (1). Sorry I didn't copy that part of the code. (2) These two fields are equivalent. There is a 1-to-1 mapping between `SharedMemory name` to `SharedMemory object`. shared_memory and component_to_shared_memory are different structures to keep `SharedMemory object` but they essentially keep the whole mapping of `SharedMemory name` to `SharedMemory object` https://github.com/apache/storm/blob/master/storm-client/src/jvm/org/apache/storm/topology/TopologyBuilder.java#L631-L638 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services