pkuwm commented on a change in pull request #855: Make ZkBaseDataAccessor 
realm-aware
URL: https://github.com/apache/helix/pull/855#discussion_r391045595
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
 ##########
 @@ -198,21 +271,17 @@ public ZkBaseDataAccessor(String zkAddress, ZkSerializer 
zkSerializer,
    * @param zkAddress
    * @param pathBasedZkSerializer
    * @param zkClientType
+   *
+   * @deprecated it is recommended to use the builder constructor {@link 
Builder}
    */
-  public ZkBaseDataAccessor(String zkAddress, PathBasedZkSerializer 
pathBasedZkSerializer,
+  @Deprecated
+  public ZkBaseDataAccessor(String zkAddress,
+      org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer 
pathBasedZkSerializer,
 
 Review comment:
   It is to reduce duplicate code for 2 constructors that have serializer 
parameters. `BasicZkSerializer` implements the long path 
`PathBasedZkSerializer` interface in zookeeper module. So we need this long 
path zookeeper `PathBasedZkSerializer`. 
   ```
   public ZkBaseDataAccessor(String zkAddress, ZkSerializer zkSerializer, 
ZkClientType zkClientType) {
     this(zkAddress, new BasicZkSerializer(zkSerializer), zkClientType);
   }
   ```
   Cons: `new BasicZkSerializer(zkSerializer)` just follows the behavior in 
ZkClientConfig. If it is changed in ZkClientConfig to use another instance 
other than BasicZkSerializer, the one here would not follow that change. 
   Well, if we don't want to reduce the duplicate code, we can just keep the 
original code.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to