diff --git a/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java b/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java index a03cf5e28..315727a6d 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/servers/ZooKeeperAnnouncer.java @@ -158,7 +158,7 @@ public class ZooKeeperAnnouncer implements D2ServiceDiscoveryEventHelper /** * Whether the announcer has completed sending a dark warmup cluster markup intent. */ - private final AtomicBoolean _isDarkWarmupMarkedUp = new AtomicBoolean(false); + private final AtomicBoolean _isDarkWarmupMarkUpIntentSent = new AtomicBoolean(false); // String to store the name of the dark warm-up cluster, defaults to null private final String _warmupClusterName; @@ -455,7 +455,7 @@ public void onError(Throwable e) @Override public void onSuccess(None result) { - _isDarkWarmupMarkedUp.set(false); + _isDarkWarmupMarkUpIntentSent.set(false); emitSDStatusActiveUpdateIntentAndWriteEvents(_warmupClusterName, false, true, _warmupClusterMarkDownStartAtRef.get()); // Mark _isWarmingUp to false to indicate warm up has completed _isWarmingUp = false; @@ -506,7 +506,7 @@ public void onError(Throwable e) @Override public void onSuccess(None result) { - _isDarkWarmupMarkedUp.set(true); + _isDarkWarmupMarkUpIntentSent.set(true); emitSDStatusActiveUpdateIntentAndWriteEvents(_warmupClusterName, true, true, _warmupClusterMarkUpStartAtRef.get()); _log.info("markUp for uri {} on warm-up cluster {} succeeded", _uri, _warmupClusterName); // Mark _isWarmingUp to true to indicate warm up is in progress @@ -819,14 +819,14 @@ public boolean isMarkUpFailed() return _markUpFailed; } - public boolean isMarkedUp() + public boolean isMarkUpIntentSent() { return _isMarkUpIntentSent.get(); } - public boolean isDarkWarmupMarkedUp() + public boolean isDarkWarmupMarkUpIntentSent() { - return _isDarkWarmupMarkedUp.get(); + return _isDarkWarmupMarkUpIntentSent.get(); } public int getMaxWeightBreachedCount() diff --git a/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmx.java b/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmx.java index 351c96159..0fcbe33bf 100644 --- a/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmx.java +++ b/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmx.java @@ -185,14 +185,14 @@ public boolean isMarkUpFailed() { } @Override - public boolean isMarkedUp() + public boolean isMarkUpIntentSent() { - return _announcer.isMarkedUp(); + return _announcer.isMarkUpIntentSent(); } @Override - public boolean isDarkWarmupMarkedUp() { - return _announcer.isDarkWarmupMarkedUp(); + public boolean isDarkWarmupMarkUpIntentSent() { + return _announcer.isDarkWarmupMarkUpIntentSent(); } @Override diff --git a/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmxMXBean.java b/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmxMXBean.java index 0289a3bc7..70cd1c716 100644 --- a/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmxMXBean.java +++ b/d2/src/main/java/com/linkedin/d2/jmx/ZooKeeperAnnouncerJmxMXBean.java @@ -74,14 +74,16 @@ void setPartitionDataUsingJson(String partitionDataJson) boolean isMarkUpFailed(); /** - * @return true if the announcer is marked up. + * @return true if the announcer has completed sending a markup intent. NOTE THAT a mark-up intent sent does NOT mean the + * announcement status on service discovery registry is up. Service discovery registry may further process the host + * and determine its status. Check on service discovery registry for the final status. */ - boolean isMarkedUp(); + boolean isMarkUpIntentSent(); /** - * @return true if the announcer marked up the dark warmup cluster. + * @return true if the announcer has completed sending a dark warmup cluster markup intent. */ - boolean isDarkWarmupMarkedUp(); + boolean isDarkWarmupMarkUpIntentSent(); /** * @return the times that the max weight has been breached. @@ -90,7 +92,7 @@ void setPartitionDataUsingJson(String partitionDataJson) /** * - * @return the times that the max number of decimal places on weight have been breached. + * @return the times that the max number of decimal places on weight has been breached. */ int getWeightDecimalPlacesBreachedCount(); }