@InterfaceAudience.Private public class ProtobufLogReader extends ReaderBase
<PB_WAL_MAGIC><WALHeader><WALEdits>...<WALEdits><Trailer> <TrailerSize> <PB_WAL_COMPLETE_MAGIC>
The Reader reads meta information (WAL Compression state, WALTrailer, etc) ininitReader(FSDataInputStream). A WALTrailer is an extensible structure
which is appended at the end of the WAL. This is empty for now; it can contain some meta
information such as Region level stats, etc in future.| Modifier and Type | Field and Description |
|---|---|
protected WALCellCodec.ByteStringUncompressor |
byteStringUncompressor |
protected Codec.Decoder |
cellDecoder |
protected boolean |
hasCompression |
protected boolean |
hasTagCompression |
protected org.apache.hadoop.fs.FSDataInputStream |
inputStream |
compressionContext, conf, edit, emptyCompressionContext, fileLength, fs, path, trailer, trailerWarnSize| Constructor and Description |
|---|
ProtobufLogReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected WALCellCodec |
getCodec(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext) |
long |
getPosition() |
WALProtos.WALTrailer |
getWALTrailer() |
protected boolean |
hasCompression() |
protected boolean |
hasTagCompression() |
protected void |
initAfterCompression()
Initializes the compression after the shared stuff has been initialized.
|
protected void |
initReader(org.apache.hadoop.fs.FSDataInputStream stream)
Initializes the log reader with a particular stream (may be null).
|
protected boolean |
readHeader(WALProtos.WALHeader.Builder builder,
org.apache.hadoop.fs.FSDataInputStream stream) |
protected boolean |
readNext(HLog.Entry entry)
Read next entry.
|
void |
reset() |
protected void |
seekOnFs(long pos)
Performs a filesystem-level seek to a certain position in an underlying file.
|
init, next, next, seekprotected org.apache.hadoop.fs.FSDataInputStream inputStream
protected Codec.Decoder cellDecoder
protected WALCellCodec.ByteStringUncompressor byteStringUncompressor
protected boolean hasCompression
protected boolean hasTagCompression
public void close()
throws IOException
IOExceptionpublic long getPosition()
throws IOException
IOExceptionpublic void reset()
throws IOException
IOExceptionprotected void initReader(org.apache.hadoop.fs.FSDataInputStream stream)
throws IOException
ReaderBaseinitReader in class ReaderBaseIOExceptionprotected boolean readHeader(WALProtos.WALHeader.Builder builder, org.apache.hadoop.fs.FSDataInputStream stream) throws IOException
IOExceptionprotected WALCellCodec getCodec(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext) throws IOException
IOExceptionprotected void initAfterCompression()
throws IOException
ReaderBaseinitAfterCompression in class ReaderBaseIOExceptionprotected boolean hasCompression()
hasCompression in class ReaderBaseprotected boolean hasTagCompression()
hasTagCompression in class ReaderBaseprotected boolean readNext(HLog.Entry entry) throws IOException
ReaderBasereadNext in class ReaderBaseentry - The entry to read into.IOExceptionpublic WALProtos.WALTrailer getWALTrailer()
getWALTrailer in interface HLog.ReadergetWALTrailer in class ReaderBaseprotected void seekOnFs(long pos)
throws IOException
ReaderBaseseekOnFs in class ReaderBaseIOExceptionCopyright © 2014 The Apache Software Foundation. All Rights Reserved.