-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command zookeeper registry #49
Conversation
motan-registry-command-zookeeper的功能可以直接合并到motan-registry-zookeeper里吧,没有必要再新建一个工程。 |
这个之前跟 @rayzhang0603 交流过,他觉得两个独立开比较好,不需要指令支持的就不包含指令相关的代码,内部的configserver也是这么用的... |
我理解这个没有新的依赖,应用场景也类似,指令支持应该也是基本特性之一,没必要分开。 |
16ac9da
to
f5de4e3
Compare
f5de4e3
to
34e2263
Compare
@qdaxb 功能已完成,请求merge |
6fec8b1
to
6e57383
Compare
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
public class CommandZookeeperRegistry extends CommandFailbackRegistry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个类应该是在zookeeper registry的基础上增加了功能,为什么还要把zookeeper registry的功能实现一遍?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另一个是直接继承的FailbackRegistry,这个继承的是CommandFailbackRegistry,重写了部分FailbackRegistry的方法,增加了servicelistener和commandlistener
两个类只是服务注册的逻辑一样,服务发现和客户端订阅的逻辑变化比较多
ebb9a2f
to
fab32d0
Compare
fab32d0
to
3f00591
Compare
try { | ||
Map<NotifyListener, IZkChildListener> childChangeListeners = urlListeners.get(url); | ||
Map<ServiceListener, IZkChildListener> childChangeListeners = serviceListeners.get(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsubscribe时没有清childChangeListeners的map,是否有场景会造成内存泄漏?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个我理解是client在订阅service的时候,对于同一个clienturl,订阅这个service时不会重复添加childChangeListeners,只要clienturl数量是可控的就OK
如果要清除的话就是加个逻辑判断childChangeListeners是否为空,若为空就置null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我理解如果client一直在变化,而server不重启的话,有可能有溢出的问题。
LGTM |
feat: 支持指令的ZooKeeper注册中心
@qdaxb @half-dead