use of org.apache.tez.runtime.library.api.IOInterruptedException in project tez by apache.
the class MROutput method getWriter.
/**
* Get a key value write to write Map Reduce compatible output
*/
@Override
public KeyValueWriter getWriter() throws IOException {
return new KeyValueWriter() {
private final boolean useNewWriter = useNewApi;
@SuppressWarnings("unchecked")
@Override
public void write(Object key, Object value) throws IOException {
if (useNewWriter) {
try {
newRecordWriter.write(key, value);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOInterruptedException("Interrupted while writing next key-value", e);
}
} else {
oldRecordWriter.write(key, value);
}
outputRecordCounter.increment(1);
getContext().notifyProgress();
}
};
}
use of org.apache.tez.runtime.library.api.IOInterruptedException in project tez by apache.
the class MRReaderMapReduce method next.
@Override
public boolean next() throws IOException {
boolean hasNext;
try {
hasNext = recordReader.nextKeyValue();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOInterruptedException("Interrupted while checking for next key-value", e);
}
if (hasNext) {
inputRecordCounter.increment(1);
notifyProgress();
} else {
hasCompletedProcessing();
completedProcessing = true;
notifyDone();
}
return hasNext;
}
Aggregations