Curator教程(一)快速入门

本文是Curator的快速入门教程,介绍了如何配置环境、添加Maven依赖,以及创建Curator连接实例、创建节点、获取节点值、设置节点值、检查节点存在和删除节点的基本操作。Curator是Netflix为Zookeeper提供的一个高级客户端,简化了Zookeeper的使用。
摘要由CSDN通过智能技术生成

Curator是Netflix公司开源的一个Zookeeper客户端,与Zookeeper提供的原生客户端相比,Curator的抽象层次更高,简化了Zookeeper客户端编程。

它包含以下几个组件:

Component description
Recipes Implementations of some of the common ZooKeeper “recipes”. The implementations are built on top of the Curator Framework.
Framework The Curator Framework is a high-level API that greatly simplifies using ZooKeeper. It adds many features that build on ZooKeeper and handles the complexity of managing connections to the ZooKeeper cluster and retrying operations.
Utilities Various utilities that are useful when using ZooKeeper.
Client A replacement for the bundled ZooKeeper class that takes care of some low-level housekeeping and provides some useful utilities.
Errors How Curator deals with errors, connection issues, recoverable exceptions, etc.
Extensions The curator-recipes package implements the common recipes that are described in the ZooKeeper documentation. To avoid bloating that package, recipes/applications that have a vertical appeal will be put in separate “extension” packages using the naming convention curator-x-name.

环境配置

  • JDK 1.7
  • Zookeeper 3.4.8
  • Curator 2.11.1
  • Maven 3.3

快速入门

Maven依赖
<properties>
    <java.version>1.7</java.version>
    <curator.version>2.11.1</curator.version>
</properties>

<dependencies>
    <dependency>
        <groupId>
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值