TreeSet<String> fetchZkChildren(Watcher watcher) throws InterruptedException, KeeperException {
  while (true) {
    try {
      TreeSet<String> orderedChildren=new TreeSet<>();
      List<String> childNames=zookeeper.getChildren(dir,watcher,true);
      stats.setQueueLength(childNames.size());
      for (      String childName : childNames) {
        if (!childName.regionMatches(0,PREFIX,0,PREFIX.length())) {
          LOG.debug("Found child node with improper name: " + childName);
          continue;
        }
        orderedChildren.add(childName);
      }
      return orderedChildren;
    }
 catch (    KeeperException.NoNodeException e) {
      zookeeper.makePath(dir,false,true);
    }
  }
}

TreeSet < String > fetchZkChildren ( Watcher watcher ) throws InterruptedException , KeeperException { while ( true ) { try { TreeSet < String > orderedChildren = new TreeSet < > ( ) ; List < String > childNames = zookeeper . getChildren ( dir , watcher , true ) ; stats . setQueueLength ( childNames . size ( ) ) ; for ( String childName : childNames ) { if ( ! childName . regionMatches ( 0 , PREFIX , 0 , PREFIX . length ( ) ) ) { LOG . debug ( "Found child node with improper name: " + childName ) ; continue ; } orderedChildren . add ( childName ) ; } return orderedChildren ; } catch ( KeeperException . NoNodeException e ) { zookeeper . makePath ( dir , false , true ) ; } } }
return the current set of children from zk ; does not change internal state .
