Skip to content

Commit

Permalink
Upgrade to Curator 5.1
Browse files Browse the repository at this point in the history
Descriptions of the changes in this PR:

Curator 5.x support ZooKeeper 3.6.x.
This change is needed to able the upgrade of Pulsar to ZooKeeper 3.6.2 

### Changes

Upgrade Curator


Reviewers: Anup Ghatage <[email protected]>

This closes apache#2491 from eolivelli/fix/test-curator-5
  • Loading branch information
eolivelli committed Dec 28, 2020
1 parent 886f5ab commit 2abfdff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<commons-lang3.version>3.6</commons-lang3.version>
<commons-io.version>2.4</commons-io.version>
<bouncycastle.version>1.60</bouncycastle.version>
<curator.version>4.0.1</curator.version>
<curator.version>5.1.0</curator.version>
<dropwizard.version>3.1.0</dropwizard.version>
<etcd.version>0.0.2</etcd.version>
<freebuilder.version>1.14.9</freebuilder.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.apache.bookkeeper.stream.storage.api.cluster.ClusterMetadataStore;
import org.apache.bookkeeper.stream.storage.exceptions.StorageRuntimeException;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.NodeCache;
import org.apache.curator.framework.recipes.cache.NodeCacheListener;
import org.apache.distributedlog.impl.metadata.BKDLConfig;
import org.apache.distributedlog.metadata.DLMetadata;
Expand All @@ -48,6 +47,7 @@
* A zookeeper based implementation of cluster metadata store.
*/
@Slf4j
@SuppressWarnings("deprecation")
public class ZkClusterMetadataStore implements ClusterMetadataStore {

private final CuratorFramework client;
Expand All @@ -58,7 +58,7 @@ public class ZkClusterMetadataStore implements ClusterMetadataStore {
private final String zkClusterAssignmentPath;

private final Map<Consumer<Void>, NodeCacheListener> assignmentDataConsumers;
private NodeCache assignmentDataCache;
private org.apache.curator.framework.recipes.cache.NodeCache assignmentDataCache;

private volatile boolean closed = false;

Expand Down Expand Up @@ -155,7 +155,8 @@ public void updateClusterAssignmentData(ClusterAssignmentData assigmentData) {
public void watchClusterAssignmentData(Consumer<Void> watcher, Executor executor) {
synchronized (this) {
if (assignmentDataCache == null) {
assignmentDataCache = new NodeCache(client, zkClusterAssignmentPath);
assignmentDataCache = new org.apache.curator.framework.recipes.cache.NodeCache(client,
zkClusterAssignmentPath);
try {
assignmentDataCache.start();
} catch (Exception e) {
Expand Down

0 comments on commit 2abfdff

Please sign in to comment.