helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hu...@apache.org
Subject [helix.wiki] branch master updated: Updated New Modules for Apache Helix (markdown)
Date Tue, 04 Feb 2020 17:35:50 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.wiki.git


The following commit(s) were added to refs/heads/master by this push:
     new 86bcafc  Updated New Modules for Apache Helix (markdown)
86bcafc is described below

commit 86bcafc4313a91ec1f5360e974ae5c4772f99fda
Author: Hunter Lee <narendly@gmail.com>
AuthorDate: Tue Feb 4 09:35:47 2020 -0800

    Updated New Modules for Apache Helix (markdown)
---
 New-Modules-for-Apache-Helix.md | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/New-Modules-for-Apache-Helix.md b/New-Modules-for-Apache-Helix.md
index 0ed8596..7395545 100644
--- a/New-Modules-for-Apache-Helix.md
+++ b/New-Modules-for-Apache-Helix.md
@@ -30,4 +30,15 @@ Find-replace in your project:
 E.g.) 
 import org.I0Itec.zkclient.ZkServer; 
 becomes
-import org.apache.helix.zookeeper.api.zkclient.ZkServer;
\ No newline at end of file
+import org.apache.helix.zookeeper.api.zkclient.ZkServer;
+
+3. If you use I0Itec's ZkClient directly in your project, you'll want to change those to
using HelixZkClient via the static factories provided. There are two types of factories Helix
provides:
+1. SharedZkClientFactory - one shared ZkClient that has multiple ZkConnections inside it.
Use for CRUD operations.
+2. DedicatedZkClientFactory - one ZkClient with one ZkConnection. The behavior of this is
same as if you used a raw ZkClient.
+
+`    ZkClient client = new ZkClient("localhost:2191", 10000, 10000, new ZNRecordSerializer());
+    HelixZkClient.ZkConnectionConfig zkConnectionConfig =
+        new HelixZkClient.ZkConnectionConfig("localhost:2191")
+            .setSessionTimeout(10000);
+    HelixZkClient client = DedicatedZkClientFactory.getInstance().buildZkClient(zkConnectionConfig,
+        new HelixZkClient.ZkClientConfig().setZkSerializer(new ZNRecordSerializer()));`
\ No newline at end of file


Mime
View raw message