You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/08/12 06:42:16 UTC

[GitHub] [dubbo] BurningCN opened a new pull request, #10445: Optimize the logic of zkDataListener

BurningCN opened a new pull request, #10445:
URL: https://github.com/apache/dubbo/pull/10445

   **现状**
   目前ZK监听的逻辑是,所有的ConfigurationListener都在CacheListener中维护。
   
   给ZK添加监听器的时候,每个path对应一个CuratorZookeeperClient.NodeCacheListenerImpl,且所有的NodeCacheListenerImpl都是映射的同一个CacheListener。每当有任意一个path的监听事件发生的时候,都需要在CacheListener根据path取出对应的Set<ConfigurationListener>,并每次都需要解析出group和key,然后调用ConfigurationListener#process。
   
   **调整**
   现在增加ZookeeperDataListener,使得一个NodeCacheListenerImpl只对应一个ZookeeperDataListener,这样path事件触发直接获取ZookeeperDataListener的Set<ConfigurationListener>,然后调用ConfigurationListener#process。使得path、NodeCacheListenerImpl、ZookeeperDataListener三者一一对应,关系更明确、独立。
   
   TreePathDynamicConfiguration#doAddListener方法冗余传递key和group,用以赋值到ZookeeperDataListener的属性中,这样每次事件发生的时候不需要再像原有逻辑那样根据rootPath以及path来解析key和group。
   
   CacheListener内部只维护path和ZookeeperDataListener的映射关系,事件监听逻辑即dataChanged方法挪到了 ZookeeperDataListener 。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ merged pull request #10445: Optimize the logic of zkDataListener

Posted by GitBox <gi...@apache.org>.
AlbumenJ merged PR #10445:
URL: https://github.com/apache/dubbo/pull/10445


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org