Class AbstractProtobufLogWriter
java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.AbstractProtobufLogWriter
- Direct Known Subclasses:
AsyncProtobufLogWriter
,ProtobufLogWriter
Base class for Protobuf log writer.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Codec.Encoder
protected CompressionContext
protected WALCellCodec.ByteStringCompressor
protected org.apache.hadoop.conf.Configuration
protected Encryptor
protected AtomicLong
private static final org.slf4j.Logger
protected org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer
protected int
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader
buildSecureWALHeader
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader.Builder builder) private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader
buildWALHeader
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader.Builder builder) private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer
buildWALTrailer
(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer.Builder builder) protected void
It is straight forward to close the output, do not need to write trailer like the Writer.closeprivate WALCellCodec
getCodec
(org.apache.hadoop.conf.Configuration conf, CompressionContext compressionContext) long
protected abstract OutputStream
private String
void
init
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, boolean overwritable, long blocksize, StreamSlowMonitor monitor) private void
initAfterHeader
(boolean doCompress) private boolean
initializeCompressionContext
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path) protected abstract void
initOutput
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, boolean overwritable, int bufferSize, short replication, long blockSize, StreamSlowMonitor monitor, boolean noLocalWrite) private void
secureInitAfterHeader
(boolean doCompress, Encryptor encryptor) (package private) void
setWALTrailer
(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer walTrailer) protected abstract long
writeMagicAndWALHeader
(byte[] magic, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header) return the file length after written.protected final void
protected abstract long
writeWALTrailerAndMagic
(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer, byte[] magic)
-
Field Details
-
LOG
-
compressionContext
-
conf
-
encryptor
-
cellEncoder
-
compressor
-
trailerWritten
-
trailer
-
trailerWarnSize
-
length
-
-
Constructor Details
-
AbstractProtobufLogWriter
public AbstractProtobufLogWriter()
-
-
Method Details
-
getCodec
private WALCellCodec getCodec(org.apache.hadoop.conf.Configuration conf, CompressionContext compressionContext) throws IOException - Throws:
IOException
-
buildWALHeader
private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader buildWALHeader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader.Builder builder) throws IOException - Throws:
IOException
-
buildSecureWALHeader
private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader buildSecureWALHeader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader.Builder builder) throws IOException - Throws:
IOException
-
getWriterClassName
-
initializeCompressionContext
private boolean initializeCompressionContext(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-
init
public void init(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, boolean overwritable, long blocksize, StreamSlowMonitor monitor) throws IOException, CommonFSUtils.StreamLacksCapabilityException -
initAfterHeader
- Throws:
IOException
-
secureInitAfterHeader
- Throws:
IOException
-
setWALTrailer
void setWALTrailer(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer walTrailer) -
getLength
-
buildWALTrailer
private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer buildWALTrailer(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer.Builder builder) -
writeWALTrailer
-
initOutput
protected abstract void initOutput(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, boolean overwritable, int bufferSize, short replication, long blockSize, StreamSlowMonitor monitor, boolean noLocalWrite) throws IOException, CommonFSUtils.StreamLacksCapabilityException -
closeOutputIfNecessary
It is straight forward to close the output, do not need to write trailer like the Writer.close -
writeMagicAndWALHeader
protected abstract long writeMagicAndWALHeader(byte[] magic, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header) throws IOException return the file length after written.- Throws:
IOException
-
writeWALTrailerAndMagic
protected abstract long writeWALTrailerAndMagic(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer, byte[] magic) throws IOException - Throws:
IOException
-
getOutputStreamForCellEncoder
-