All Projects → RabbitTeam → Zookeeper Client

RabbitTeam / Zookeeper Client

Licence: apache-2.0
Provides the basic zk operation, but also additionally encapsulates the commonly used functions to make it easier for .NET developers to use zookeeper better.

Labels

Projects that are alternatives of or similar to Zookeeper Client

Ansible Playbook
Ansible playbook to deploy distributed technologies
Stars: ✭ 61 (-41.35%)
Mutual labels:  zookeeper
Hadoop cookbook
Cookbook to install Hadoop 2.0+ using Chef
Stars: ✭ 82 (-21.15%)
Mutual labels:  zookeeper
Zookeeper
Apache ZooKeeper
Stars: ✭ 10,061 (+9574.04%)
Mutual labels:  zookeeper
Eshop Soa
EShop基于Dubbo实现SOA服务化拆分,并基于RocketMQ解决了分布式事务(新版SpringBootSOASkeleton)
Stars: ✭ 65 (-37.5%)
Mutual labels:  zookeeper
Easyrpc
EasyRpc is a simple, high-performance, easy-to-use RPC framework based on Netty, ZooKeeper and ProtoStuff.
Stars: ✭ 79 (-24.04%)
Mutual labels:  zookeeper
E3mall
宜立方商城,SOA架构学习项目
Stars: ✭ 91 (-12.5%)
Mutual labels:  zookeeper
Express Microservice Starter
An express-based Node.js API bootstrapping module for building microservices.
Stars: ✭ 53 (-49.04%)
Mutual labels:  zookeeper
Simple Rpc
RPC with service discovery base on netty
Stars: ✭ 103 (-0.96%)
Mutual labels:  zookeeper
Zookeeper Cookbook
Chef cookbook for installing and managing Zookeeper.
Stars: ✭ 80 (-23.08%)
Mutual labels:  zookeeper
Bigdata Notes
大数据入门指南 ⭐
Stars: ✭ 10,991 (+10468.27%)
Mutual labels:  zookeeper
Burrowui
This is a NodeJS/Angular 2 frontend UI for Kafka cluster monitoring with Burrow
Stars: ✭ 69 (-33.65%)
Mutual labels:  zookeeper
Netty Stroll
RPC基础通信框架
Stars: ✭ 77 (-25.96%)
Mutual labels:  zookeeper
Repository
个人学习知识库涉及到数据仓库建模、实时计算、大数据、Java、算法等。
Stars: ✭ 92 (-11.54%)
Mutual labels:  zookeeper
Zookeeper Console
A zookeeper visual web application based on SpringBoot、Curator and Bootstrap
Stars: ✭ 63 (-39.42%)
Mutual labels:  zookeeper
Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-3.85%)
Mutual labels:  zookeeper
Commonx
基础框架
Stars: ✭ 57 (-45.19%)
Mutual labels:  zookeeper
Jeeplatform
一款企业信息化开发基础平台,拟集成OA(办公自动化)、CMS(内容管理系统)等企业系统的通用业务功能 JeePlatform项目是一款以SpringBoot为核心框架,集ORM框架Mybatis,Web层框架SpringMVC和多种开源组件框架而成的一款通用基础平台,代码已经捐赠给开源中国社区
Stars: ✭ 1,285 (+1135.58%)
Mutual labels:  zookeeper
Whatsmars
Java生态研究(Spring Boot + Redis + Dubbo + RocketMQ + Elasticsearch)🔥🔥🔥🔥🔥
Stars: ✭ 1,389 (+1235.58%)
Mutual labels:  zookeeper
Kubernetes Zookeeper
This project contains tools to facilitate the deployment of Apache ZooKeeper on Kubernetes.
Stars: ✭ 102 (-1.92%)
Mutual labels:  zookeeper
Zookeeper Cpp
A ZooKeeper client for C++.
Stars: ✭ 98 (-5.77%)
Mutual labels:  zookeeper

Rabbit ZooKeeper Extensions

The project uses the Apache ZooKeeper .NET async Client component, in addition to providing the basic zk operation, but also additional encapsulation of the commonly used functions in order to allow. Net developers to better use zookeeper.

Features

  1. session expired
  2. Permanent watcher
  3. Recursively delete nodes
  4. Recursively create nodes
  5. Cross-platform (support. Net core)

Instructions for use

Create connection

IZookeeperClient client = new ZookeeperClient(new ZookeeperClientOptions("172.18.20.132:2181")
        {
            BasePath = "/", //default value
            ConnectionTimeout = TimeSpan.FromSeconds(10), //default value
            SessionTimeout = TimeSpan.FromSeconds(20), //default value
            OperatingTimeout = TimeSpan.FromSeconds(60), //default value
            ReadOnly = false, //default value
            SessionId = 0, //default value
            SessionPasswd = null //default value
            EnableEphemeralNodeRestore = true //default value
        });

Create node

var data = Encoding.UTF8.GetBytes("2016");

//Fast create temporary nodes
await client.CreateEphemeralAsync("/year", data);
await client.CreateEphemeralAsync("/year", data, ZooDefs.Ids.OPEN_ACL_UNSAFE);

//Fast create permanent nodes
await client.CreatePersistentAsync("/year", data);
await client.CreatePersistentAsync("/year", data, ZooDefs.Ids.OPEN_ACL_UNSAFE);

//Full call
await client.CreateAsync("/year", data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);

//Recursively created
await client.CreateRecursiveAsync("/microsoft/netcore/aspnet", data);

Get node data

IEnumerable<byte> data = await client.GetDataAsync("/year");
Encoding.UTF8.GetString(data.ToArray());

Get the child node

IEnumerable<string> children= await client.GetChildrenAsync("/microsoft");

Determine whether the node exists

bool exists = await client.ExistsAsync("/year");

Delete the node

await client.DeleteAsync("/year");

//Recursively deleted
bool success = await client.DeleteRecursiveAsync("/microsoft");

update data

Stat stat = await client.SetDataAsync("/year", Encoding.UTF8.GetBytes("2017"));

Subscription data changes

await client.SubscribeDataChange("/year", (ct, args) =>
{
    IEnumerable<byte> currentData = args.CurrentData;
    string path = args.Path;
    Watcher.Event.EventType eventType = args.Type;
    return Task.CompletedTask;
});

Subscription node changes

await client.SubscribeChildrenChange("/microsoft", (ct, args) =>
{
    IEnumerable<string> currentChildrens = args.CurrentChildrens;
    string path = args.Path;
    Watcher.Event.EventType eventType = args.Type;
    return Task.CompletedTask;
});

FAQ

When will the "SubscribeDataChange" event be triggered?

The event subscribed by the "SubscribeDataChange" method is triggered in the following cases:

  1. The node is created
  2. The node is deleted
  3. Node data changes
  4. zk connection re-successful

When will the "SubscribeChildrenChange" event be triggered?

The event subscribed by the "SubscribeChildrenChange" method is triggered in the following cases:

  1. The node is created
  2. The node is deleted
  3. Node node changes
  4. zk connection re-successful

How do I distinguish the status of a node in the "xxxxChange" event?

In the event trigger parameter will have a type "EventType" attribute "Type", through this attribute can clearly distinguish the reasons for node changes.

Why write this program, it and "ZooKeeperEx" What is the difference?

Officially provided components, only provide the basic api, in the normal use of the zk needs to do very complicated things, breed a lot of additional code and can not guarantee the correctness of its implementation.

In the java language also has the official zk package package ZKClient, the current component is also a reference to this project. What are the specific packages that are available? Please refer to the section "Features Provided".

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].