public void createPersistent ( String path , Object data , boolean createParents ) throws ZkInterruptedException , IllegalArgumentException , ZkException , RuntimeException { try { create ( path , data , CreateMode . PERSISTENT ) ; } catch ( ZkNodeExistsException e ) { if ( ! createParents ) { throw e ; } } catch ( ZkNoNodeException e ) { if ( ! createParents ) { throw e ; } String parentDir = path . substring ( 0 , path . lastIndexOf ( ' ' ) ) ; createPersistent ( parentDir , createParents ) ; createPersistent ( path , data , createParents ) ; } }
Create a persistent Sequential node .