private void scanDirs() throws FileNotFoundException {
      dirList.clear();
      dirList.addAll(logTailDirs);
      for (String d : dirList) {
        for (File f : new File(d).listFiles(LOG_FILES)) {
          String filePath = f.getAbsolutePath();
          if (!tailedFiles.contains(filePath)) {
            tailedFiles.add(filePath);
            startTailingFile(filePath);
          }
        }
      }
    }
Generates a list of random port numbers in the sorted order. A sorted order makes sense if we
ever want to refer to these servers by their index in the returned array, e.g. server #0, #1,
etc.
hbase-diagnostics/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java