public synchronized long get ( ) throws IOException { try { lastZNodeStat = zooKeeper . exists ( fullyQualifiedZNode , false ) ; if ( lastZNodeStat == null ) { return - 1 ; } byte [ ] data = zooKeeper . getData ( fullyQualifiedZNode , false , lastZNodeStat ) ; WritableUtil . readWritableFromByteArray ( data , maxTxIdWritable ) ; return maxTxIdWritable . get ( ) ; } catch ( KeeperException e ) { keeperException ( "Unrecoverable ZooKeeper error reading " + fullyQualifiedZNode , e ) ; return - 1 ; // This is never reached } catch ( InterruptedException e ) { interruptedException ( "Interrupted reading " + fullyQualifiedZNode , e ) ; return - 1 ; // This is never reached } }
Get the current max transaction id from ZooKeeper