@GuardedBy("exclusiveLock") private boolean isFinishedInternal() { checkLockHeld("Lock must be held to call isFinishedInternal"); boolean finished = state.get() != State.ALIVE || driverContext.isDone() || activeOperators.isEmpty() || activeOperators.get(activeOperators.size() - 1).isFinished(); if (finished) { state.compareAndSet(State.ALIVE, State.NEED_DESTRUCTION); } return finished; }
@GuardedBy("exclusiveLock") private void processNewSources() checkLockHeld("Lock must be held to call processNewSources");
@GuardedBy("exclusiveLock") private void destroyIfNecessary() checkLockHeld("Lock must be held to call destroyIfNecessary");
@GuardedBy("exclusiveLock") private ListenableFuture<?> processInternal(OperationTimer operationTimer) checkLockHeld("Lock must be held to call processInternal");
private boolean isFinishedInternal() { checkLockHeld("Lock must be held to call isFinishedInternal"); boolean finished = state.get() != State.ALIVE || driverContext.isDone() || operators.get(operators.size() - 1).isFinished(); if (finished) { state.compareAndSet(State.ALIVE, State.NEED_DESTRUCTION); } return finished; }
private void processNewSources() { checkLockHeld("Lock must be held to call processNewSources"); // only update if the driver is still alive if (state.get() != State.ALIVE) { return; } // copy the pending sources // it is ok to "miss" a source added during the copy as it will be // handled on the next call to this method Map<PlanNodeId, TaskSource> sources = new HashMap<>(newSources); for (Entry<PlanNodeId, TaskSource> entry : sources.entrySet()) { // Remove the entries we are going to process from the newSources map. // It is ok if someone already updated the entry; we will catch it on // the next iteration. newSources.remove(entry.getKey(), entry.getValue()); processNewSource(entry.getValue()); } }
private void processNewSource(TaskSource source) checkLockHeld("Lock must be held to call processNewSources");
private void destroyIfNecessary() checkLockHeld("Lock must be held to call destroyIfNecessary");
private ListenableFuture<?> processInternal() checkLockHeld("Lock must be held to call processInternal");