ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Apache Curator与Zookeeper版本兼容性异常:org.apache.zookeeper.KeeperException$UnimplementedException: KeeperE

2021-12-06 16:00:42  阅读:407  来源: 互联网

标签:use Zookeeper UnimplementedException ZooKeeper KeeperErrorCode Curator 3.4 zooke


ZooKeeper Version 3.4.x Compatibility

ZooKeeper 3.4.x is now at end-of-life. Consequently, the latest versions of Curator have removed support for it. If you wish to use Curator with ZooKeeper 3.4.x you should pin to version 4.2.x of Curator. Curator 4.2.x supports ZooKeeper 3.4.x ensembles in a soft-compatibility mode. To use this mode you must exclude ZooKeeper when adding Curator to your dependency management tool.

Maven

<dependency>
    <groupId>org.apache.curator</groupId>
    <artifactId>curator-recipes</artifactId>
    <version>4.2.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Gradle

compile('org.apache.curator:curator-recipes:$curatorVersion') {
  exclude group: 'org.apache.zookeeper', module: 'zookeeper'
}

You must add a dependency on ZooKeeper 3.4.x also.

Curator will detect which ZooKeeper library is in use and automatically set ZooKeeper 3.4 compatibility mode as needed. In this mode, all features not supported by 3.4 are disabled. It is up to your application code to "do the right thing" and not use these features. Use the isZk34CompatibilityMode() method to determine which mode Curator is using at runtime.

Testing With ZooKeeper 3.4.x

Note: If you wish to use Curator's TestingServer with ZooKeeper 3.4.x you must use the older version of it (in addition to the instructions above):

Maven

<dependency>
    <groupId>org.apache.curator</groupId>
    <artifactId>curator-test</artifactId>
    <version>2.12.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
        </exclusion>
    </exclusions>
    <scope>test</scope>
</dependency>

Gradle

testCompile('org.apache.curator:curator-test:2.12.0') {
  exclude group: 'org.apache.zookeeper', module: 'zookeeper'
}


Curator 5.0 Breaking Changes

Curator 5.0 contains a few non-backward compatible/breaking changes from previous versions.

  • ZooKeeper 3.4.x is no longer supported (the associated Compatibility classes/methods have been removed). If you still need to use Curator with ZooKeeper 3.4.x you will need to use a previous version. Click here for details.
  • The old ListenerContainer classes have been removed so as not to leak Guava classes into Curator APIs. Instead use the new StandardListenerManager.
  • Exhibitor support has been removed.
  • ConnectionHandlingPolicy and related classes have been removed.
  • The Reaper and ChildReaper classes/recipes have been removed. You should use ZooKeeper container nodes instead.
  • newPersistentEphemeralNode() and newPathChildrenCache() were removed from GroupMember.
  • ServiceCacheBuilder<T> executorService(CloseableExecutorService executorService) was removed from ServiceCacheBuilder.
  • ServiceProviderBuilder<T> executorService(CloseableExecutorService executorService) was removed from ServiceProviderBuilder.
  • static boolean shouldRetry(int rc) was removed from RetryLoop.
  • static boolean isRetryException(Throwable exception) was removed from RetryLoop.
 

标签:use,Zookeeper,UnimplementedException,ZooKeeper,KeeperErrorCode,Curator,3.4,zooke
来源: https://www.cnblogs.com/felixzh/p/15650291.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有