Пример #1
0
  public synchronized ListenableFuture<?> enqueueSplit(
      TaskHandle taskHandle, SplitRunner taskSplit) {
    PrioritizedSplitRunner prioritizedSplitRunner =
        new PrioritizedSplitRunner(taskHandle, taskSplit, ticker);
    taskHandle.addSplit(prioritizedSplitRunner);

    scheduleTaskIfNecessary(taskHandle);

    addNewEntrants();

    return prioritizedSplitRunner.getFinishedFuture();
  }
Пример #2
0
  private synchronized void splitFinished(PrioritizedSplitRunner split) {
    allSplits.remove(split);
    pendingSplits.remove(split);

    TaskHandle taskHandle = split.getTaskHandle();
    taskHandle.splitComplete(split);

    wallTime.add(System.nanoTime() - split.createdNanos);

    scheduleTaskIfNecessary(taskHandle);

    addNewEntrants();
  }