protected void ensureExists ( final String path , final byte [ ] data , final List < ACL > acl , final CreateMode flags ) { try { retryOperation ( new ZooKeeperOperation ( ) { public boolean execute ( ) throws KeeperException , InterruptedException { Stat stat = zookeeper . exists ( path , false ) ; if ( stat != null ) { return true ; } zookeeper . create ( path , data , acl , flags ) ; return true ; } } ) ; } catch ( KeeperException e ) { LOG . warn ( "Caught: " + e , e ) ; } catch ( InterruptedException e ) { LOG . warn ( "Caught: " + e , e ) ; } }
Ensures that the given path exists with the given data ACL and flags