You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/18 06:19:13 UTC

[GitHub] [shardingsphere] taojintianxia commented on a change in pull request #12544: Modify add event for Etcd

taojintianxia commented on a change in pull request #12544:
URL: https://github.com/apache/shardingsphere/pull/12544#discussion_r711518219



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-etcd/src/main/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepository.java
##########
@@ -114,7 +114,7 @@ public void delete(final String key) {
     public void watch(final String key, final DataChangedEventListener dataChangedEventListener) {
         Watch.Listener listener = Watch.listener(response -> {
             for (WatchEvent each : response.getEvents()) {
-                Type type = getEventChangedType(each);
+                Type type = 1 == each.getKeyValue().getVersion() ? Type.ADDED : getEventChangedType(each);

Review comment:
       why not put this logic into getEventChangedType(WatchEvent each) ?




-- 
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@shardingsphere.apache.org

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