pinot-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@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
Date Mon, 03 Feb 2020 18:33:57 GMT
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<String> 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


Mime
View raw message