You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/02/03 18:33:57 UTC
[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
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