mirror of
https://github.com/apache/nifi.git
synced 2025-02-16 15:06:00 +00:00
NIFI-3986: This closes #1868. When we encounted EOFException from sequential record reader event iterator, just treat it as not having any more events
Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
parent
7035694e37
commit
2595d816c4
@ -68,7 +68,18 @@ public class SequentialRecordReaderEventIterator implements EventIterator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
final ProvenanceEventRecord event = reader.nextRecord();
|
ProvenanceEventRecord event;
|
||||||
|
try {
|
||||||
|
event = reader.nextRecord();
|
||||||
|
} catch (final EOFException eof) {
|
||||||
|
// We have run out of data. Treat the same as getting back null.
|
||||||
|
// This happens particularly if reading the same file that is being
|
||||||
|
// written to (because we use a BufferedOutputStream to write to it, so we
|
||||||
|
// may read half-way through a record and then hit the end of what was
|
||||||
|
// buffered and flushed).
|
||||||
|
event = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
if (rotateReader()) {
|
if (rotateReader()) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user