You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/04/12 21:32:54 UTC

[GitHub] [helix] xyuanlu commented on a diff in pull request #2032: Code refactor and cleanup on instance validation

xyuanlu commented on code in PR #2032:
URL: https://github.com/apache/helix/pull/2032#discussion_r848888358


##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/util/DelayedRebalanceUtil.java:
##########
@@ -137,14 +138,13 @@ private static long getInactiveTime(String instance, Set<String> liveInstances,
     }
 
     // check the time instance got disabled.
-    if (!instanceConfig.getInstanceEnabled() || (clusterConfig.getDisabledInstances() != null
-        && clusterConfig.getDisabledInstances().containsKey(instance))) {
+    if (!InstanceValidationUtil.isInstanceEnabled(instanceConfig, clusterConfig)) {
       long disabledTime = instanceConfig.getInstanceEnabledTime();
-      if (clusterConfig.getDisabledInstances() != null && clusterConfig.getDisabledInstances()
-          .containsKey(instance)) {
+      Map<String, String> disabledInstances = clusterConfig.getDisabledInstances();
+      if (disabledInstances.containsKey(instance)) {

Review Comment:
   We could use clusterConfig.getInstanceHelixDisabledTimeStamp() ?



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org