From commits-return-15874-archive-asf-public=cust-asf.ponee.io@pinot.apache.org Mon Feb 3 18:33:58 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 8975518067C for ; Mon, 3 Feb 2020 19:33:58 +0100 (CET) Received: (qmail 67415 invoked by uid 500); 3 Feb 2020 18:33:58 -0000 Mailing-List: contact commits-help@pinot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pinot.apache.org Delivered-To: mailing list commits@pinot.apache.org Received: (qmail 67390 invoked by uid 99); 3 Feb 2020 18: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; Mon, 03 Feb 2020 18:33:57 +0000 From: GitBox To: commits@pinot.apache.org Subject: [GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #4952: Adding new Controller APIs for retrieving and setting tag for an instance Message-ID: <158075483786.5359.7686213039238251167.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Mon, 03 Feb 2020 18:33:57 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Jackie-Jiang commented on a change in pull request #4952: Adding new Controller APIs for retrieving and setting tag for an instance URL: https://github.com/apache/incubator-pinot/pull/4952#discussion_r374268191 ########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java ########## @@ -358,6 +358,19 @@ public synchronized PinotResourceManagerResponse addInstance(Instance instance) } } + /** + * Update a given instance for the specified Instance ID + */ + public synchronized PinotResourceManagerResponse updateInstance(String instanceIdToUpdate, Instance newInstance) { + List instances = getAllInstances(); + if (!instances.contains(instanceIdToUpdate)) { + return PinotResourceManagerResponse.failure("Instance " + instanceIdToUpdate + " does not exists"); + } else { + _helixAdmin.setInstanceConfig(_helixClusterName, instanceIdToUpdate, newInstance.toInstanceConfig()); Review comment: This won't be able the change the instance host/port. In order to do that, you need to use data accessor to set it. ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org For additional commands, e-mail: commits-help@pinot.apache.org