xyuanlu commented on code in PR #2032:
URL: https://github.com/apache/helix/pull/2032#discussion_r848946412
##########
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:
Here we read from clusterConfig to get getDisabledInstances and parse target
instance's disabled info to get timestamp.
There is a getter in clusterConfig to get disabled time
(getInstanceHelixDisabledTimeStamp). We could use that directly.
--
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]