@InterfaceAudience.Private public abstract class AbstractProtobufWALReader extends Object implements AbstractFSWALProvider.Initializer, Closeable
| Modifier and Type | Field and Description |
|---|---|
protected WALCellCodec.ByteStringUncompressor |
byteStringUncompressor |
protected Codec.Decoder |
cellDecoder |
protected String |
codecClsName |
protected CompressionContext |
compressionCtx |
protected org.apache.hadoop.conf.Configuration |
conf |
protected Decryptor |
decryptor |
protected long |
fileLength |
protected org.apache.hadoop.fs.FileSystem |
fs |
protected boolean |
hasCompression |
protected boolean |
hasTagCompression |
protected boolean |
hasValueCompression |
protected org.apache.hadoop.fs.FSDataInputStream |
inputStream |
protected org.apache.hadoop.fs.Path |
path |
static byte[] |
PB_WAL_COMPLETE_MAGIC |
static byte[] |
PB_WAL_MAGIC |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer |
trailer |
protected boolean |
trailerPresent |
protected int |
trailerWarnSize |
protected Compression.Algorithm |
valueCompressionType |
protected long |
walEditsStopOffset |
| Constructor and Description |
|---|
AbstractProtobufWALReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected IOException |
extractHiddenEof(Exception ex) |
protected abstract InputStream |
getCellCodecInputStream(org.apache.hadoop.fs.FSDataInputStream stream)
Get or create the input stream used by cell decoder.
|
String |
getCodecClsName()
Returns the cell codec classname
|
long |
getPosition() |
protected String |
getPositionQuietly() |
List<String> |
getWriterClsNames()
Returns names of the accepted writer classes
|
void |
init(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
long startPosition)
A method to initialize a WAL reader.
|
protected void |
initWALCellCodec(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header,
InputStream inputStream) |
protected boolean |
isWALTrailer(long startPosition)
This is used to determine whether we have already reached the WALTrailer.
|
protected Pair<org.apache.hadoop.fs.FSDataInputStream,org.apache.hadoop.fs.FileStatus> |
open() |
protected boolean |
reachWALEditsStopOffset(long pos) |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader |
readHeader(org.apache.hadoop.fs.FSDataInputStream stream) |
protected void |
readTrailer(org.apache.hadoop.fs.FSDataInputStream stream,
org.apache.hadoop.fs.FileStatus stat) |
protected abstract void |
skipTo(long position)
Skip to the given position.
|
long |
trailerSize() |
public static final byte[] PB_WAL_MAGIC
public static final byte[] PB_WAL_COMPLETE_MAGIC
protected org.apache.hadoop.conf.Configuration conf
protected org.apache.hadoop.fs.FileSystem fs
protected org.apache.hadoop.fs.Path path
protected long fileLength
protected org.apache.hadoop.fs.FSDataInputStream inputStream
protected CompressionContext compressionCtx
protected boolean hasCompression
protected boolean hasTagCompression
protected boolean hasValueCompression
protected Compression.Algorithm valueCompressionType
protected Codec.Decoder cellDecoder
protected WALCellCodec.ByteStringUncompressor byteStringUncompressor
protected long walEditsStopOffset
protected boolean trailerPresent
protected org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer
protected int trailerWarnSize
protected String codecClsName
protected Decryptor decryptor
protected abstract InputStream getCellCodecInputStream(org.apache.hadoop.fs.FSDataInputStream stream)
protected abstract void skipTo(long position)
throws IOException
IOExceptionpublic void init(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
long startPosition)
throws IOException
AbstractFSWALProvider.Initializerinit in interface AbstractFSWALProvider.InitializerstartPosition - the start position you want to read from, -1 means start reading from
the first WAL entry. Notice that, the first entry is not started at
position as we have several headers, so typically you should not pass 0
here.IOExceptionprotected final Pair<org.apache.hadoop.fs.FSDataInputStream,org.apache.hadoop.fs.FileStatus> open() throws IOException
IOExceptionprotected final org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader readHeader(org.apache.hadoop.fs.FSDataInputStream stream) throws IOException
IOExceptionprotected final void initWALCellCodec(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header, InputStream inputStream) throws IOException
IOExceptionprotected final void readTrailer(org.apache.hadoop.fs.FSDataInputStream stream,
org.apache.hadoop.fs.FileStatus stat)
throws IOException
IOExceptionprotected final boolean reachWALEditsStopOffset(long pos)
public List<String> getWriterClsNames()
public String getCodecClsName()
public long getPosition()
throws IOException
IOExceptionpublic long trailerSize()
protected final String getPositionQuietly()
protected final IOException extractHiddenEof(Exception ex)
protected final boolean isWALTrailer(long startPosition)
throws IOException
IOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.