Skip to content

Commit

Permalink
Reliably call Operator.finish() even if blocked
Browse files Browse the repository at this point in the history
Before this commit, `Operator.finish()` could be called when operator is
blocked, but only if it got blocked during last `addInput()`.  This
commit removes this condition and makes delivery of `finish()`
unconditionally clear.
  • Loading branch information
findepi authored and losipiuk committed Jun 20, 2017
1 parent b8a1bf4 commit 7d11573
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,13 @@ private ListenableFuture<?> processInternal()
Operator current = operators.get(i);
Operator next = operators.get(i + 1);

// skip blocked operators
// skip blocked operator
if (getBlockedFuture(current).isPresent()) {
continue;
}
if (getBlockedFuture(next).isPresent()) {
continue;
}

// if the current operator is not finished and next operator needs input...
if (!current.isFinished() && next.needsInput()) {
// if the current operator is not finished and next operator isn't blocked and needs input...
if (!current.isFinished() && !getBlockedFuture(next).isPresent() && next.needsInput()) {
// get an output page from current operator
current.getOperatorContext().startIntervalTimer();
Page page = current.getOutput();
Expand Down

0 comments on commit 7d11573

Please sign in to comment.