Constructor and Description |
---|
LogFileReader() |
Modifier and Type | Method and Description |
---|---|
void |
configure(LogConfiguration config)
Configures this reader.
|
List<String> |
tail(int sizeToRead,
long writePos)
retrieves the tail of the log, up to size bytes, line by line.
|
public void configure(LogConfiguration config) throws IOException
LogReader
configure
in interface LogReader
config
- specifies what log to readIOException
public List<String> tail(int sizeToRead, long writePos) throws IOException
LogReader
tail
in interface LogReader
sizeToRead
- limits the number of bytes to readwritePos
- position of the current writer. This is a hint to the
reader as to how far it can seek into the latest log.
This is necessary because we are reading into the latest
file while it is still open for write, and hence the
file system status will not give us a precise file length.IOException
Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.