@InterfaceAudience.Private public class ReplicationWALReaderManager extends Object
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf |
private org.apache.hadoop.fs.FileSystem |
fs |
private org.apache.hadoop.fs.Path |
lastPath |
private static org.apache.commons.logging.Log |
LOG |
private long |
position |
private WAL.Reader |
reader |
Constructor and Description |
---|
ReplicationWALReaderManager(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf)
Creates the helper but doesn't open any file
Use setInitialPosition after using the constructor if some content needs to be skipped
|
Modifier and Type | Method and Description |
---|---|
void |
closeReader()
Close the current reader
|
long |
currentTrailerSize() |
(package private) void |
finishCurrentFile()
Tell the helper to reset internal state
|
long |
getPosition()
Get the position that we stopped reading at
|
WAL.Reader |
openReader(org.apache.hadoop.fs.Path path)
Opens the file at the current position
|
WAL.Entry |
readNextAndSetPosition()
Get the next entry, returned and also added in the array
|
void |
seek()
Advance the reader to the current position
|
void |
setPosition(long pos) |
private static final org.apache.commons.logging.Log LOG
private final org.apache.hadoop.fs.FileSystem fs
private final org.apache.hadoop.conf.Configuration conf
private long position
private WAL.Reader reader
private org.apache.hadoop.fs.Path lastPath
public ReplicationWALReaderManager(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
fs
- conf
- public WAL.Reader openReader(org.apache.hadoop.fs.Path path) throws IOException
path
- IOException
public WAL.Entry readNextAndSetPosition() throws IOException
IOException
public void seek() throws IOException
IOException
public long getPosition()
public void setPosition(long pos)
public long currentTrailerSize()
public void closeReader() throws IOException
IOException
void finishCurrentFile()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.