Ethanlm commented on a change in pull request #3302:
URL: https://github.com/apache/storm/pull/3302#discussion_r450407478
##########
File path: storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java
##########
@@ -3370,8 +3378,18 @@ public void rebalance(String topoName, RebalanceOptions options)
checkAuthorization(topoName, topoConf, operation);
// Set principal in RebalanceOptions to nil because users are not suppose to
set this
options.set_principal(null);
+ // check if executor counts are correctly specified
+ StormTopology stormTopology = tryReadTopologyFromName(topoName);
+ Set<String> comps = new HashSet<>();
+ comps.addAll(stormTopology.get_spouts().keySet());
+ comps.addAll(stormTopology.get_bolts().keySet());
Map<String, Integer> execOverrides = options.is_set_num_executors() ? options.get_num_executors()
: Collections.emptyMap();
- for (Integer value : execOverrides.values()) {
+ for (Map.Entry<String, Integer> e: execOverrides.entrySet()) {
+ String comp = e.getKey();
+ Integer value = e.getValue();
+ if (!comps.contains(comp)) {
Review comment:
What does `rebalance` do with system components like `acker` and metricConsumers?
Will users be able to rebalance those?
----------------------------------------------------------------
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:
users@infra.apache.org
|