@InterfaceAudience.Private @InterfaceStability.Evolving public class ReliableTaildirEventReader extends Object implements ReliableEventReader
Modifier and Type | Class and Description |
---|---|
static class |
ReliableTaildirEventReader.Builder
Special builder class for ReliableTaildirEventReader
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Clean-up any state associated with this reader.
|
void |
commit()
Commit the last lines which were read.
|
Map<Long,TailFile> |
getTailFiles() |
void |
loadPositionFile(String filePath)
Load a position file which has the last read position of each file.
|
Event |
readEvent()
Get the next line associated with the input stream.
|
List<Event> |
readEvents(int numEvents)
Get up to
n lines associated with the input stream. |
List<Event> |
readEvents(int numEvents,
boolean backoffWithoutNL) |
List<Event> |
readEvents(TailFile tf,
int numEvents) |
void |
setCurrentFile(TailFile currentFile) |
List<Long> |
updateTailFiles() |
List<Long> |
updateTailFiles(boolean skipToEnd)
Update tailFiles mapping if a new file is created or appends are detected
to the existing file.
|
public void loadPositionFile(String filePath)
public void setCurrentFile(TailFile currentFile)
public Event readEvent() throws IOException
EventReader
null
, the input underlying input source is considered finished.
Note that this is allowed to block for indefinite amounts of time waiting
to generate a new line.readEvent
in interface EventReader
IOException
public List<Event> readEvents(int numEvents) throws IOException
EventReader
n
lines associated with the input stream. If this returns
less than n lines, the input underlying input source is considered
finished. Note that this is allowed to block for indefinite amounts of
time waiting to generate a new line.readEvents
in interface EventReader
IOException
public List<Event> readEvents(TailFile tf, int numEvents) throws IOException
IOException
public List<Event> readEvents(int numEvents, boolean backoffWithoutNL) throws IOException
IOException
public void close() throws IOException
EventReader
close
in interface Closeable
close
in interface AutoCloseable
close
in interface EventReader
IOException
public void commit() throws IOException
commit
in interface ReliableEventReader
IOException
public List<Long> updateTailFiles(boolean skipToEnd) throws IOException
IOException
public List<Long> updateTailFiles() throws IOException
IOException
Copyright © 2009–2019 Apache Software Foundation. All rights reserved.