From 8c2133c3ba9d58ee3ef5316ae913f8483f6f7f48 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Thu, 21 Nov 2024 13:54:07 -0800 Subject: [PATCH] comment on the announcement mode enum instead of reordering it --- .../com/linkedin/d2/balancer/LoadBalancerServer.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/d2/src/main/java/com/linkedin/d2/balancer/LoadBalancerServer.java b/d2/src/main/java/com/linkedin/d2/balancer/LoadBalancerServer.java index 6982eef55..c329c9b98 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/LoadBalancerServer.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/LoadBalancerServer.java @@ -74,18 +74,19 @@ void addUriSpecificProperty(String clusterName, /** * Get announce mode of the server. Some server may have different announce mode, e.g. dual write mode, force announce - * mode. + * mode. NOTE the order of the enum shows the migration progress. The ordinal is used in JMX --- each number higher + * means one more step completed in the migration --- which can ease devs to know the status. */ AnnounceMode getAnnounceMode(); enum AnnounceMode { STATIC_OLD_SR_ONLY, // statically only announce to old service registry - STATIC_NEW_SR_ONLY, // statically only announce to new service registry - STATIC_NEW_SR_ONLY_NO_WRITE_BACK, // statically only announce to new service registry without writing back to old service registry DYNAMIC_OLD_SR_ONLY, // dynamically only announce to old service registry DYNAMIC_DUAL_WRITE, // dynamically announce to both service registries DYNAMIC_NEW_SR_ONLY, // dynamically only announce to new service registry - DYNAMIC_FORCE_DUAL_WRITE // Using dynamic server yet forced to announce to both service registries + DYNAMIC_FORCE_DUAL_WRITE, // Using dynamic server yet forced to announce to both service registries + STATIC_NEW_SR_ONLY, // statically only announce to new service registry + STATIC_NEW_SR_ONLY_NO_WRITE_BACK // statically only announce to new service registry without writing back to old service registry } }