MarkGaox commented on code in PR #2687:
URL: https://github.com/apache/helix/pull/2687#discussion_r1379093505


##########
helix-core/src/main/java/org/apache/helix/util/InstanceValidationUtil.java:
##########
@@ -239,6 +240,23 @@ public static boolean hasErrorPartitions(HelixDataAccessor 
dataAccessor, String
     return false;
   }
 
+  /**
+   * Checks if the specified instance is marked for an ongoing instance 
operation. Currently,
+   * this method only checks for evacuation.
+   *
+   * @param dataAccessor The accessor for retrieving Helix data properties.
+   * @param instanceName An instance to be evaluated.
+   * @return
+   */
+  public static boolean isOperationSetForInstance(HelixDataAccessor 
dataAccessor,
+      String instanceName) {
+    PropertyKey.Builder propertyKeyBuilder = dataAccessor.keyBuilder();
+    InstanceConfig instanceConfig =
+        
dataAccessor.getProperty(propertyKeyBuilder.instanceConfig(instanceName));
+    return InstanceConstants.InstanceOperation.EVACUATE.name()

Review Comment:
   There is another check `INSTANCE_NOT_ENABLED` that does this 
`InstanceValidationUtil.isEnabled(_dataAccessor, instanceName));`



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to