swuferhong commented on code in PR #1380:
URL: https://github.com/apache/fluss/pull/1380#discussion_r2649659194


##########
fluss-server/src/main/java/org/apache/fluss/server/zk/ZooKeeperClient.java:
##########
@@ -1188,6 +1192,49 @@ public void insertConfigChangeNotification() throws 
Exception {
                         
ZkData.ConfigEntityChangeNotificationSequenceZNode.encode());
     }
 
+    // 
--------------------------------------------------------------------------------------------
+    // Maintenance
+    // 
--------------------------------------------------------------------------------------------
+
+    public void registerServerTags(ServerTags newServerTags) throws Exception {
+        String path = ServerTagsZNode.path();
+        if (getOrEmpty(path).isPresent()) {
+            zkClient.setData().forPath(path, 
ServerTagsZNode.encode(newServerTags));
+        } else {
+            zkClient.create()
+                    .creatingParentsIfNeeded()
+                    .withMode(CreateMode.PERSISTENT)
+                    .forPath(path, ServerTagsZNode.encode(newServerTags));
+        }
+    }
+
+    public Optional<ServerTags> getServerTags() throws Exception {
+        String path = ServerTagsZNode.path();
+        return getOrEmpty(path).map(ServerTagsZNode::decode);
+    }
+
+    public void registerRebalancePlan(RebalancePlan rebalancePlan) throws 
Exception {
+        String path = RebalanceZNode.path();
+        if (getOrEmpty(path).isPresent()) {
+            zkClient.setData().forPath(path, 
RebalanceZNode.encode(rebalancePlan));
+        } else {
+            zkClient.create()
+                    .creatingParentsIfNeeded()
+                    .withMode(CreateMode.PERSISTENT)
+                    .forPath(path, RebalanceZNode.encode(rebalancePlan));
+        }
+    }
+
+    public Optional<RebalancePlan> getRebalancePlan() throws Exception {
+        String path = RebalanceZNode.path();
+        return getOrEmpty(path).map(RebalanceZNode::decode);
+    }
+
+    public void deleteRebalancePlan() throws Exception {

Review Comment:
   I agree with your changes. I've removed the `deleteRebalancePlan` method and 
added a new `updateRebalancePlan` method. Additionally, I introduced a new 
field `rebalance_status` in the `RebalancePlan`. Now, each time we check the 
status to determine whether the rebalance has completed or already failed.



-- 
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]

Reply via email to