public synchronized ListenableFuture<?> enqueueSplit( TaskHandle taskHandle, SplitRunner taskSplit) { PrioritizedSplitRunner prioritizedSplitRunner = new PrioritizedSplitRunner(taskHandle, taskSplit, ticker); taskHandle.addSplit(prioritizedSplitRunner); scheduleTaskIfNecessary(taskHandle); addNewEntrants(); return prioritizedSplitRunner.getFinishedFuture(); }
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(); }