tillrohrmann commented on a change in pull request #10754: 
[FLINK-14091][coordination] Allow updates to connection state when 
ZKCheckpointIDCounter reconnects to ZK
URL: https://github.com/apache/flink/pull/10754#discussion_r366364492
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/ZooKeeperCheckpointIDCounter.java
 ##########
 @@ -150,32 +171,15 @@ public void setCount(long newId) throws Exception {
                sharedCount.setCount((int) newId);
        }
 
-       @VisibleForTesting
-       ConnectionState getLastState() {
-               return connStateListener.lastState;
-       }
-
-       /**
-        * Connection state listener. In case of {@link 
ConnectionState#SUSPENDED} or {@link
-        * ConnectionState#LOST} we are not guaranteed to read a current count 
from ZooKeeper.
-        */
-       private static class SharedCountConnectionStateListener implements 
ConnectionStateListener {
-
-               private volatile ConnectionState lastState;
+       private void checkConnectionState() {
+               final ConnectionState lastState = this.lastState;
 
 Review comment:
   I would not shadow the local variable. One could rename the variable 
`currentLastState`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to