zoukankan      html  css  js  c++  java
  • zookeeper 学习笔记1(转)

    本文转自https://www.cnblogs.com/fanguangdexiaoyuer/p/7077520.html 感谢作者
    可以设置观察的操作:exists,getChildren,getData
    可以触发观察的操作:create,delete,setData
     
    zookeeper观察机制;
    服务端只存储事件的信息,
    客户端存储事件的信息和Watcher的执行逻辑.
    ZooKeeper客户端是线程安全的。
    每一个应用只需要实例化一个ZooKeeper客户端即可,
    同一个ZooKeeper客户端实例可以在不同的线程中使用。
     
    zookeeper观察机制;
    服务端只存储事件的信息,
    客户端存储事件的信息和Watcher的执行逻辑.
    ZooKeeper客户端是线程安全的。
    每一个应用只需要实例化一个ZooKeeper客户端即可,
    同一个ZooKeeper客户端实例可以在不同的线程中使用。
     
    zookeeper观察机制;
    服务端只存储事件的信息,
    客户端存储事件的信息和Watcher的执行逻辑.
    ZooKeeper客户端是线程安全的。
    每一个应用只需要实例化一个ZooKeeper客户端即可,
    同一个ZooKeeper客户端实例可以在不同的线程中使用。
     
     
    ZooKeeper客户端会将这个Watcher对应Path路径存储在ZKWatchManager中,同时通知ZooKeeper服务器记录该Client对应的Session中的Path下注册的事件类型。当ZooKeeper服务器发生了指定的事件后,ZooKeeper服务器将通知ZooKeeper客户端哪个节点下发生事件类型,ZooKeeper客户端再从ZKWatchManager中找到相应Path,取出相应watcher引用执行其回调函数process。
  • 相关阅读:
    iOS 页面之间的转场动画控制器间的转换
    C C语言中关键词,以及知识点复习
    iOS Swift基础知识代码
    LeetCode-Kth Smallest Element in a Sorted Matrix
    LeetCode-Design Phone Directory
    LeetCode-Longest Increasing Path in a Matrix
    LeetCode-Pathcing Array
    LeetCode-Wiggle Sort
    LeetCode-Odd Even Linked List
    LeetCode-Verify Preorder Serialization of a Binary Tree
  • 原文地址:https://www.cnblogs.com/panxuejun/p/8566366.html
Copyright © 2011-2022 走看看