private void findPrefixInChildren(String prefix,ZooKeeper zookeeper,String dir) throws KeeperException, InterruptedException {
  List<String> names=zookeeper.getChildren(dir,false);
  for (  String name : names) {
    if (name.startsWith(prefix)) {
      id=name;
      if (LOG.isDebugEnabled()) {
        LOG.debug("Found id created last time: " + id);
      }
      break;
    }
  }
  if (id == null) {
    id=zookeeper.create(dir + "/" + prefix,data,getAcl(),EPHEMERAL_SEQUENTIAL);
    if (LOG.isDebugEnabled()) {
      LOG.debug("Created id: " + id);
    }
  }
}

private void findPrefixInChildren ( String prefix , ZooKeeper zookeeper , String dir ) throws KeeperException , InterruptedException { List < String > names = zookeeper . getChildren ( dir , false ) ; for ( String name : names ) { if ( name . startsWith ( prefix ) ) { id = name ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Found id created last time: " + id ) ; } break ; } } if ( id == null ) { id = zookeeper . create ( dir + "/" + prefix , data , getAcl ( ) , EPHEMERAL_SEQUENTIAL ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Created id: " + id ) ; } } }
find if we have been created earler if not create our node
