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
FieldsModifier and TypeFieldDescriptionprotected Codec.Encoderprotected CompressionContextprotected WALCellCodec.ByteStringCompressorprotected org.apache.hadoop.conf.Configurationprotected Encryptorprotected AtomicLongprivate static final org.slf4j.Loggerprotected org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailerprotected intprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeaderbuildSecureWALHeader(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.WALHeaderbuildWALHeader(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.WALTrailerbuildWALTrailer(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer.Builder builder) protected voidIt is straight forward to close the output, do not need to write trailer like the Writer.closeprivate WALCellCodecgetCodec(org.apache.hadoop.conf.Configuration conf, CompressionContext compressionContext) longprotected abstract OutputStreamprivate Stringvoidinit(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 voidinitAfterHeader(boolean doCompress) private booleaninitializeCompressionContext(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path) protected abstract voidinitOutput(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 voidsecureInitAfterHeader(boolean doCompress, Encryptor encryptor) (package private) voidsetWALTrailer(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer walTrailer) protected abstract longwriteMagicAndWALHeader(byte[] magic, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header) return the file length after written.protected final voidprotected abstract longwriteWALTrailerAndMagic(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
-