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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to