Zookeeper
雪碧bubble
这个作者很懒,什么都没留下…
展开
-
Zookeeper介绍,事件Watcher
1.什么是Zookeeper?原创 2019-04-08 17:57:43 · 182 阅读 · 0 评论 -
Zookeeper实现分布式锁
1.传统业务场景 在一个项目中,需要生成一个全局的唯一ID,现在的方案有UUID,时间戳。用多线程模拟生成。 //生成id类 public class NumGenerator { //全局id public static int count = 0; public String getNumber() { try { Thread.sleep(200); } catc...原创 2019-04-09 19:20:25 · 160 阅读 · 0 评论