storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [storm] Ethanlm commented on a change in pull request #3302: [STORM-3666] Validate component name in rebalance command
Date Thu, 09 Jul 2020 19:08:21 GMT

Ethanlm commented on a change in pull request #3302:

File path: storm-server/src/main/java/org/apache/storm/daemon/nimbus/
@@ -3380,16 +3381,21 @@ public void rebalance(String topoName, RebalanceOptions options)
             // check if executor counts are correctly specified
             StormTopology stormTopology = tryReadTopologyFromName(topoName);
-            Set<String> comps = new HashSet<>();
+            Set<String> comps = new TreeSet<>();
             Map<String, Integer> execOverrides = options.is_set_num_executors() ? options.get_num_executors()
: Collections.emptyMap();
             for (Map.Entry<String, Integer> e: execOverrides.entrySet()) {
                 String comp = e.getKey();
-                Integer value = e.getValue();
-                if (!comps.contains(comp)) {
-                    throw new WrappedInvalidTopologyException(String.format("Component %s
does not exist in topology %s", comp, topoName));
+                // validate non-system component ids
+                if (!Utils.isSystemId(comp) && !comps.contains(comp)) {

Review comment:
       Maybe we can follow the code at
to get all the components?
   Or maybe use stormBase to avoid recomputation.
   Not sure if there is any concern with using this without testing it. Maybe there are some
corner cases that need to be taken care of.

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:

View raw message