private boolean previousZKSessionStillActive()
    {
        try {
            byte[] json = zk.get().getData(String.format("/%s/nodes/%s", name, myNodeID), false, null);
            NodeInfo nodeInfo = JsonUtil.fromJSON(json, NodeInfo.class);
            return (nodeInfo.connectionID == zk.get().getSessionId());
        } catch (NoNodeException e) {
            ; // apparently harmless?
        } catch (Exception e) {
            LOG.error("Encountered unexpected error in checking ZK session status.", e);
        }
        return false;
    }
private boolean previousZKSessionStillActive ( ) { try { byte [ ] json = zk . get ( ) . getData ( String . format ( "/%s/nodes/%s" , name , myNodeID ) , false , null ) ; NodeInfo nodeInfo = JsonUtil . fromJSON ( json , NodeInfo . class ) ; return ( nodeInfo . connectionID == zk . get ( ) . getSessionId ( ) ) ; } catch ( NoNodeException e ) { ; } catch ( Exception e ) { LOG . error ( "Encountered unexpected error in checking ZK session status." , e ) ; } return false ; }
Determines if another ZooKeeper session is currently active for the current node
by comparing the ZooKeeper session ID of the connection stored in NodeState.