From dev-return-62046-archive-asf-public=cust-asf.ponee.io@storm.apache.org Wed Jul 8 19:33:59 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C083A180663 for ; Wed, 8 Jul 2020 21:33:58 +0200 (CEST) Received: (qmail 14943 invoked by uid 500); 8 Jul 2020 19:33:57 -0000 Mailing-List: contact dev-help@storm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@storm.apache.org Delivered-To: mailing list dev@storm.apache.org Received: (qmail 14916 invoked by uid 99); 8 Jul 2020 19:33:57 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jul 2020 19:33:57 +0000 From: =?utf-8?q?GitBox?= To: dev@storm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bstorm=5D_bipinprasad_commented_on_a_change_in_pull?= =?utf-8?q?_request_=233302=3A_=5BSTORM-3666=5D_Validate_component_name_in_r?= =?utf-8?q?ebalance_command?= Message-ID: <159423683718.29655.2127568710925079218.asfpy@gitbox.apache.org> Date: Wed, 08 Jul 2020 19:33:57 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: bipinprasad commented on a change in pull request #3302: URL: https://github.com/apache/storm/pull/3302#discussion_r451779409 ########## 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 comps = new HashSet<>(); + comps.addAll(stormTopology.get_spouts().keySet()); + comps.addAll(stormTopology.get_bolts().keySet()); Map execOverrides = options.is_set_num_executors() ? options.get_num_executors() : Collections.emptyMap(); - for (Integer value : execOverrides.values()) { + for (Map.Entry e: execOverrides.entrySet()) { + String comp = e.getKey(); + Integer value = e.getValue(); + if (!comps.contains(comp)) { Review comment: Changed to allow system components. ---------------------------------------------------------------- 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