You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2023/01/18 20:57:45 UTC

[GitHub] [helix] desaikomal commented on a diff in pull request #2339: Implement data change listener for ZkMetaClient and test

desaikomal commented on code in PR #2339:
URL: https://github.com/apache/helix/pull/2339#discussion_r1080545253


##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClient.java:
##########
@@ -236,6 +239,10 @@ public ConnectState getClientConnectionState() {
   @Override
   public boolean subscribeDataChange(String key, DataChangeListener listener,
       boolean skipWatchingNonExistNode, boolean persistListener) {
+    if (!persistListener) {
+      throw new NotImplementedException("Non-persist (one-time) listener is not supported in ZkMetaClient.");
+    }
+    _zkClient.subscribeDataChanges(key, new DataListenerConverter(listener));

Review Comment:
   i may remember it wrong, but i thought there are 2 variations of this method, one explicitly taking listener-type. if so, can we use that variant, please



##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClient.java:
##########
@@ -236,6 +239,10 @@ public ConnectState getClientConnectionState() {
   @Override
   public boolean subscribeDataChange(String key, DataChangeListener listener,
       boolean skipWatchingNonExistNode, boolean persistListener) {
+    if (!persistListener) {
+      throw new NotImplementedException("Non-persist (one-time) listener is not supported in ZkMetaClient.");

Review Comment:
   nit: should we add "currently" or we will never support it?



##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2489,7 +2489,7 @@ public Object call() throws Exception {
     });
   }
 
-  protected void connect(final long maxMsToWaitUntilConnected)
+  public void connect(final long maxMsToWaitUntilConnected)

Review Comment:
   Any reason why this method was protected earlier? I would assume this method to be public in first place.



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org