[ https://issues.apache.org/jira/browse/STORM-893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14946544#comment-14946544 ]
ASF GitHub Bot commented on STORM-893: -------------------------------------- Github user erikdw commented on a diff in the pull request: https://github.com/apache/storm/pull/746#discussion_r41366711 --- Diff: storm-core/src/jvm/backtype/storm/scheduler/Cluster.java --- @@ -438,6 +451,35 @@ public SupervisorDetails getSupervisorById(String nodeId) { return this.supervisors; } + /* + * Note: Make sure the proper conf was passed into the Cluster constructor before calling this function + * It tries to load the proper network topography detection plugin specified in the config. + */ + public Map<String, List<String>> getNetworkTopography() { + if (networkTopography == null) { + networkTopography = new HashMap<String, List<String>>(); + ArrayList<String> supervisorHostNames = new ArrayList<String>(); + for (SupervisorDetails s : supervisors.values()) { + supervisorHostNames.add(s.getHost()); + } + + String clazz = (String) conf.get(Config.STORM_NETWORK_TOPOGRAPHY_PLUGIN); + DNSToSwitchMapping topographyMapper = (DNSToSwitchMapping) Utils.newInstance(clazz); + + Map <String,String> resolvedSuperVisors = topographyMapper.resolve(supervisorHostNames); + for(String hostName: resolvedSuperVisors.keySet()) { --- End diff -- Please use consistent for/if/while styling. i.e., most of your new code is `for(`, but some (see 9 lines above) is `for (`. It *seems* like the storm project is more consistently using `for (`. This comment also applies to the `){` at the end of various lines. That should always be `) {` IMNSHO. > Resource Aware Scheduling > ------------------------- > > Key: STORM-893 > URL: https://issues.apache.org/jira/browse/STORM-893 > Project: Apache Storm > Issue Type: Umbrella > Components: storm-core > Reporter: Robert Joseph Evans > Assignee: Boyang Jerry Peng > Attachments: resource_aware_scheduler_api.pdf > > > At Yahoo we have been working on resource aware scheduling in storm, based > off of some work done in academia. This rollup ticket is to track the > complete project. With several sub tasks. Some that are already done and > need to be pushed back, and others that we have not started on yet. -- This message was sent by Atlassian JIRA (v6.3.4#6332)