private int findPort(int start, int end) {
    int port = start;
    while (!available(port)) {
      port++;
      if (port == end) {
        throw new RuntimeException("can not find free port for range " + start + ":" + end);
      }
    }
    return port;
  }
This class has the hooks to start and stop the external Druid Nodes
itests/qtest-druid/src/main/java/org/apache/hive/druid/MiniDruidCluster.java