zookeeper源码分析
文章平均质量分 66
键圣
一个热衷于不惑的非专业不靠谱程序员
展开
-
Zookeeper源码分析之单机模式消息流动分析
这里写自定义目录标题 单机模式: #mermaid-svg-eSeL6C0646Xt3L0l .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-eSeL6C0646Xt3L0l .label text{fill:#333}#mermaid-svg-eSeL6C0646Xt3L0l .node rect,#merma原创 2021-07-25 19:10:58 · 190 阅读 · 0 评论 -
zookeeper源码分析之ExpiryQueue
ExpiryQueue是zookeeper管理客户端连接超时的工具类。它是将松散的时间按expirationInterval间隔映射成一个一个具体的时间点。 计算时间所属时间段的算法: private long roundToNextInterval(long time) { return (time / expirationInterval + 1) * expirationInterval; } time是超时时间返回的是规整后的超时时间,这一块其实在time是ex.原创 2021-07-25 18:49:28 · 194 阅读 · 0 评论