Class ProtobufWALStreamReader
java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.AbstractProtobufWALReader
org.apache.hadoop.hbase.regionserver.wal.ProtobufWALStreamReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,AbstractFSWALProvider.Initializer
,WALStreamReader
@Private
public class ProtobufWALStreamReader
extends AbstractProtobufWALReader
implements WALStreamReader, AbstractFSWALProvider.Initializer
A one way stream reader for reading protobuf based WAL file.
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.regionserver.wal.AbstractProtobufWALReader
byteStringUncompressor, cellDecoder, codecClsName, compressionCtx, conf, decryptor, DEFAULT_WAL_TRAILER_WARN_SIZE, fileLength, fs, hasCompression, hasTagCompression, hasValueCompression, inputStream, path, PB_WAL_COMPLETE_MAGIC, PB_WAL_MAGIC, trailer, trailerPresent, trailerWarnSize, valueCompressionType, WAL_TRAILER_WARN_SIZE, walEditsStopOffset
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected InputStream
getCellCodecInputStream
(org.apache.hadoop.fs.FSDataInputStream stream) Get or create the input stream used by cell decoder.Read the next entry in WAL, use the givenWAL.Entry
if notnull
to hold the data.protected void
skipTo
(long position) Skip to the given position.Methods inherited from class org.apache.hadoop.hbase.regionserver.wal.AbstractProtobufWALReader
close, extractHiddenEof, getCodecClsName, getPosition, getPositionQuietly, getWriterClsNames, init, initWALCellCodec, isWALTrailer, open, reachWALEditsStopOffset, readHeader, readTrailer, trailerSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.wal.AbstractFSWALProvider.Initializer
init
Methods inherited from interface org.apache.hadoop.hbase.wal.WALStreamReader
close, getPosition, next
-
Field Details
-
LOG
-
-
Constructor Details
-
ProtobufWALStreamReader
public ProtobufWALStreamReader()
-
-
Method Details
-
next
Description copied from interface:WALStreamReader
Read the next entry in WAL, use the givenWAL.Entry
if notnull
to hold the data. Mainly used in MR.- Specified by:
next
in interfaceWALStreamReader
- Parameters:
reuse
- the entry to be used for reading, can benull
- Throws:
IOException
-
getCellCodecInputStream
Description copied from class:AbstractProtobufWALReader
Get or create the input stream used by cell decoder. For implementing replication, we may need to limit the bytes we can read, so here we provide a method so subclasses can wrap the original input stream.- Specified by:
getCellCodecInputStream
in classAbstractProtobufWALReader
-
skipTo
Description copied from class:AbstractProtobufWALReader
Skip to the given position.- Specified by:
skipTo
in classAbstractProtobufWALReader
- Throws:
IOException
-