@InterfaceAudience.LimitedPrivate(value="Configuration") public abstract class AbstractProtobufLogWriter extends Object
Modifier and Type | Field and Description |
---|---|
protected Codec.Encoder |
cellEncoder |
protected CompressionContext |
compressionContext |
protected WALCellCodec.ByteStringCompressor |
compressor |
protected org.apache.hadoop.conf.Configuration |
conf |
protected AtomicLong |
length |
private static org.slf4j.Logger |
LOG |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer |
trailer |
protected int |
trailerWarnSize |
protected boolean |
trailerWritten |
Constructor and Description |
---|
AbstractProtobufLogWriter() |
Modifier and Type | Method and Description |
---|---|
protected 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) |
protected 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.WALHeader |
buildWALHeader0(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 |
closeOutputIfNecessary()
It is straight forward to close the output, do not need to write trailer like the Writer.close
|
private WALCellCodec |
getCodec(org.apache.hadoop.conf.Configuration conf,
CompressionContext compressionContext) |
long |
getLength() |
protected abstract OutputStream |
getOutputStreamForCellEncoder() |
protected String |
getWriterClassName() |
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) |
protected void |
initAfterHeader(boolean doCompress) |
private void |
initAfterHeader0(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) |
protected void |
secureInitAfterHeader(boolean doCompress,
Encryptor encryptor) |
protected void |
setEncryptor(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 void |
writeWALTrailer() |
protected abstract long |
writeWALTrailerAndMagic(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer,
byte[] magic) |
private static final org.slf4j.Logger LOG
protected CompressionContext compressionContext
protected org.apache.hadoop.conf.Configuration conf
protected Codec.Encoder cellEncoder
protected WALCellCodec.ByteStringCompressor compressor
protected boolean trailerWritten
protected org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer
protected int trailerWarnSize
protected AtomicLong length
public AbstractProtobufLogWriter()
private WALCellCodec getCodec(org.apache.hadoop.conf.Configuration conf, CompressionContext compressionContext) throws IOException
IOException
private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader buildWALHeader0(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader.Builder builder)
protected 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
IOException
protected final 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
IOException
protected void setEncryptor(Encryptor encryptor)
protected String getWriterClassName()
private boolean initializeCompressionContext(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path path) throws IOException
IOException
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
private void initAfterHeader0(boolean doCompress) throws IOException
IOException
protected void initAfterHeader(boolean doCompress) throws IOException
IOException
protected final void secureInitAfterHeader(boolean doCompress, Encryptor encryptor) throws IOException
IOException
void setWALTrailer(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer walTrailer)
public long getLength()
private org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer buildWALTrailer(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer.Builder builder)
protected void writeWALTrailer()
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) throws IOException, CommonFSUtils.StreamLacksCapabilityException
protected void closeOutputIfNecessary()
protected abstract long writeMagicAndWALHeader(byte[] magic, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header) throws IOException
IOException
protected abstract long writeWALTrailerAndMagic(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer, byte[] magic) throws IOException
IOException
protected abstract OutputStream getOutputStreamForCellEncoder()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.