@InterfaceAudience.Private 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 Encryptor |
encryptor |
protected AtomicLong |
length |
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 void |
closeOutputIfNecessary()
It is straight forward to close the output, do not need to write trailer like the Writer.close
|
long |
getLength() |
protected abstract OutputStream |
getOutputStreamForCellEncoder() |
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 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) |
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) |
protected CompressionContext compressionContext
protected org.apache.hadoop.conf.Configuration conf
protected Encryptor encryptor
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 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
public long getLength()
protected final 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,
boolean noLocalWrite)
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
IOExceptionprotected abstract long writeWALTrailerAndMagic(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer, byte[] magic) throws IOException
IOExceptionprotected abstract OutputStream getOutputStreamForCellEncoder()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.