|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.wal.ReaderBase
org.apache.hadoop.hbase.regionserver.wal.ProtobufLogReader
@InterfaceAudience.LimitedPrivate(value={"Coprocesssor","Phoenix","Configuration"}) public class ProtobufLogReader
A Protobuf based WAL has the following structure:
<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.
Field Summary | |
---|---|
protected WALCellCodec.ByteStringUncompressor |
byteStringUncompressor
|
protected Codec.Decoder |
cellDecoder
|
protected boolean |
hasCompression
|
protected boolean |
hasTagCompression
|
protected org.apache.hadoop.fs.FSDataInputStream |
inputStream
|
Fields inherited from class org.apache.hadoop.hbase.regionserver.wal.ReaderBase |
---|
compressionContext, conf, edit, emptyCompressionContext, fileLength, fs, path, trailer, trailerWarnSize |
Constructor Summary | |
---|---|
ProtobufLogReader()
|
Method Summary | |
---|---|
void |
close()
|
protected WALCellCodec |
getCodec(org.apache.hadoop.conf.Configuration conf,
String cellCodecClsName,
org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext)
|
long |
getPosition()
|
WALProtos.WALTrailer |
getWALTrailer()
|
protected List<String> |
getWriterClsNames()
|
protected boolean |
hasCompression()
|
protected boolean |
hasTagCompression()
|
protected void |
initAfterCompression()
Initializes the compression after the shared stuff has been initialized. |
protected void |
initAfterCompression(String cellCodecClsName)
Initializes the compression after the shared stuff has been initialized. |
protected String |
initReader(org.apache.hadoop.fs.FSDataInputStream stream)
Initializes the log reader with a particular stream (may be null). |
protected org.apache.hadoop.hbase.regionserver.wal.ProtobufLogReader.WALHdrContext |
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. |
Methods inherited from class org.apache.hadoop.hbase.regionserver.wal.ReaderBase |
---|
init, next, next, seek |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.hadoop.fs.FSDataInputStream inputStream
protected Codec.Decoder cellDecoder
protected WALCellCodec.ByteStringUncompressor byteStringUncompressor
protected boolean hasCompression
protected boolean hasTagCompression
Constructor Detail |
---|
public ProtobufLogReader()
Method Detail |
---|
public void close() throws IOException
IOException
public long getPosition() throws IOException
IOException
public void reset() throws IOException
IOException
protected String initReader(org.apache.hadoop.fs.FSDataInputStream stream) throws IOException
ReaderBase
initReader
in class ReaderBase
IOException
protected List<String> getWriterClsNames()
protected org.apache.hadoop.hbase.regionserver.wal.ProtobufLogReader.WALHdrContext readHeader(WALProtos.WALHeader.Builder builder, org.apache.hadoop.fs.FSDataInputStream stream) throws IOException
IOException
protected WALCellCodec getCodec(org.apache.hadoop.conf.Configuration conf, String cellCodecClsName, org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext) throws IOException
IOException
protected void initAfterCompression() throws IOException
ReaderBase
initAfterCompression
in class ReaderBase
IOException
protected void initAfterCompression(String cellCodecClsName) throws IOException
ReaderBase
initAfterCompression
in class ReaderBase
cellCodecClsName
- class name of cell Codec
IOException
protected boolean hasCompression()
hasCompression
in class ReaderBase
protected boolean hasTagCompression()
hasTagCompression
in class ReaderBase
protected boolean readNext(HLog.Entry entry) throws IOException
ReaderBase
readNext
in class ReaderBase
entry
- The entry to read into.
IOException
public WALProtos.WALTrailer getWALTrailer()
getWALTrailer
in interface HLog.Reader
getWALTrailer
in class ReaderBase
protected void seekOnFs(long pos) throws IOException
ReaderBase
seekOnFs
in class ReaderBase
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |