use of org.apache.tez.runtime.library.exceptions.InputAlreadyClosedException in project tez by apache.
the class Shuffle method waitForInput.
/**
* Waits for the Shuffle and Merge to complete, and returns an iterator over the input.
* @return an iterator over the fetched input.
* @throws IOException
* @throws InterruptedException
*/
public TezRawKeyValueIterator waitForInput() throws IOException, InterruptedException, TezException {
Preconditions.checkState(runShuffleFuture != null, "waitForInput can only be called after run");
TezRawKeyValueIterator kvIter = null;
try {
kvIter = runShuffleFuture.get();
} catch (ExecutionException e) {
Throwable cause = e.getCause();
// Processor interrupted while waiting for errors, will see an InterruptedException.
handleThrowable(cause);
}
if (isShutDown.get()) {
throw new InputAlreadyClosedException();
}
if (throwable.get() != null) {
handleThrowable(throwable.get());
}
return kvIter;
}
Aggregations