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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to