@ Synchronized @ SneakyThrows ( Exception . class ) private void tryInit ( ) { if ( ! zkInit ) { // we are making remote calls under a lock but this is only done for initialization at // the start of controller process. ZKUtils . createPathIfNotExists ( zkClient , zkPath , HostContainerMap . EMPTY . toBytes ( ) ) ; hostContainerMapNode . getListenable ( ) . addListener ( this :: updateMap ) ; hostContainerMapNode . start ( true ) ; updateMap ( ) ; zkInit = true ; } }
Ensure required zk node is present in zookeeper .