container/src/main/java/com/streamsets/datacollector/runner/RunnerPool.java
public T getIdleRunner(long idleTime) {
    // Take the first runner
    QueueItem<T> item = queue.poll();

    // All runners might be currently in use, which is fine in this case.
    if(item == null) {
      return null;
    }

    // If the runner wasn't idle for the expected time, we need to put it back to the queue (it will be added to the
    // begging again).
    if((System.currentTimeMillis() - item.timestamp) < idleTime) {
      queue.add(item);
      return null;
    }

    // Otherwise we do have runner that hasn't been used for at least idleTime, so we can return it now
    return item.runner;
  }
public T getIdleRunner(long idleTime) {
    // Take the first runner
    QueueItem<T> item = queue.poll();

    // All runners might be currently in use, which is fine in this case.
    if(item == null) {
      return null;
    }

    // If the runner wasn't idle for the expected time, we need to put it back to the queue (it will be added to the
    // begging again).
    if((System.currentTimeMillis() - item.timestamp) < idleTime) {
      queue.add(item);
      return null;
    }

    // Otherwise we do have runner that hasn't been used for at least idleTime, so we can return it now
    return item.runner;
  }
Return a runner that haven't been used at least for the configured number of milliseconds.

@param idleTime Number of milliseconds when a runner is considered an "idle"
@return First runner that fits such criteria or null if there is no such runner