helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hu...@apache.org
Subject [helix] branch master updated: Add support for PathBasedZkSerializer in ZkBaseDataAccessor (#648)
Date Tue, 10 Dec 2019 02:53:17 GMT
This is an automated email from the ASF dual-hosted git repository.

hulee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 751d746  Add support for PathBasedZkSerializer in ZkBaseDataAccessor (#648)
751d746 is described below

commit 751d746abb6cb6a1fc6d8b6717d96ab06a68af00
Author: Hunter Lee <hulee@linkedin.com>
AuthorDate: Mon Dec 9 18:53:10 2019 -0800

    Add support for PathBasedZkSerializer in ZkBaseDataAccessor (#648)
    
    We need to add a custom serializer support for ZkSerializer in ZkBaseDataAccessor. But
some users might be using PathBasedZkSerializer - we need to add support for a custom PathBasedZkSerializer
as well.
---
 .../org/apache/helix/manager/zk/ZkBaseDataAccessor.java     | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
index a1422f4..fb2749e 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
@@ -102,7 +102,7 @@ public class ZkBaseDataAccessor<T> implements BaseDataAccessor<T>
{
   }
 
   /**
-   * The ZkBaseDataAccessor with custom serializer support
+   * The ZkBaseDataAccessor with custom serializer support of ZkSerializer type.
    * @param zkAddress The zookeeper address
    */
   public ZkBaseDataAccessor(String zkAddress, ZkSerializer zkSerializer) {
@@ -113,6 +113,17 @@ public class ZkBaseDataAccessor<T> implements BaseDataAccessor<T>
{
   }
 
   /**
+   * The ZkBaseDataAccessor with custom serializer support of PathBasedZkSerializer type.
+   * @param zkAddress The zookeeper address
+   */
+  public ZkBaseDataAccessor(String zkAddress, PathBasedZkSerializer zkSerializer) {
+    _zkClient = SharedZkClientFactory.getInstance().buildZkClient(
+        new HelixZkClient.ZkConnectionConfig(zkAddress),
+        new HelixZkClient.ZkClientConfig().setZkSerializer(zkSerializer));
+    _usesExternalZkClient = false;
+  }
+
+  /**
    * The default ZkBaseDataAccessor with {@link org.apache.helix.ZNRecord} as the data model;
    * Uses {@link ZNRecordSerializer} serializer
    * @param zkAddress The zookeeper address


Mime
View raw message