junkaixue commented on code in PR #2595:
URL: https://github.com/apache/helix/pull/2595#discussion_r1294069994
##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/util/DelayedRebalanceUtil.java:
##########
@@ -417,6 +432,18 @@ private static int
getMinActiveReplica(ResourceControllerDataProvider clusterDat
currentIdealState), currentIdealState, numReplica);
}
+ private static boolean isInstanceForcedToBeRebalancded(Long
offlineOrDisabledTime, long delay,
Review Comment:
NIT: add some description here. For example, what's the behavior of
lastOndemand means here.
##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/util/DelayedRebalanceUtil.java:
##########
@@ -417,6 +432,18 @@ private static int
getMinActiveReplica(ResourceControllerDataProvider clusterDat
currentIdealState), currentIdealState, numReplica);
}
+ private static boolean isInstanceForcedToBeRebalancded(Long
offlineOrDisabledTime, long delay,
+ long lastOnDemandRebalanceTimestamp) {
+ if (lastOnDemandRebalanceTimestamp == -1 || offlineOrDisabledTime == null
+ || offlineOrDisabledTime <= 0) {
+ return false;
+ }
+ long delayedInactiveTime = offlineOrDisabledTime + delay;
+ return offlineOrDisabledTime < lastOnDemandRebalanceTimestamp
+ && lastOnDemandRebalanceTimestamp < Math.min(delayedInactiveTime,
Review Comment:
discussed offline. this piece may not need.
##########
helix-core/src/main/java/org/apache/helix/model/ClusterConfig.java:
##########
@@ -1173,4 +1177,22 @@ public String getInstanceHelixDisabledTimeStamp(String
instanceName) {
}
return getDisabledInstances().get(instanceName);
}
+
+ /**
+ * @return: a unix time that represents the last time the on demand
rebalance is triggered on
+ * current cluster. Return -1 if the configuration doesn't have such record
yet.
Review Comment:
Usually, param/return is under the description
--
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]