@Override
        public void run() {
          try {
            FileInputStream fis = new FileInputStream(filePath);
            BufferedReader br = new BufferedReader(new InputStreamReader(fis));
            String line;
            while (true) {
              try {
                Thread.sleep(200);
              } catch (InterruptedException e) {
                LOG.error("Tailer for " + filePath + " interrupted");
                break;
              }
              while ((line = br.readLine()) != null) {
                line = logMsgPrefix + processLine(line);
                synchronized (printLock) {
                  if (line.endsWith("\n")) {
                    dest.print(line);
                  } else {
                    dest.println(line);
                  }
                  dest.flush();
                }
              }
            }
          } catch (IOException ex) {
            LOG.error("Failed tailing " + filePath, ex);
          }
        }
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