public ZooKeeper getZooKeeperClient ( ) { if ( zookeeper == null ) { try { zookeeper = createZooKeeperClient ( ) ; int retryAttempts = 5 ; while ( ! zookeeper . getState ( ) . isConnected ( ) && retryAttempts > 0 ) { LOG . debug ( "connecting..." ) ; retryAttempts -- ; Thread . sleep ( 1000 ) ; } } catch ( IOException | InterruptedException e ) { throw new CitrusRuntimeException ( e ) ; } } return zookeeper ; }
Constructs or gets the zookeeper client implementation .