@InterfaceAudience.Private public class ProtobufLogWriter extends AbstractProtobufLogWriter implements FSHLogProvider.Writer
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.fs.FSDataOutputStream |
output |
cellEncoder, compressionContext, compressor, conf, length, trailer, trailerWarnSize, trailerWritten
Constructor and Description |
---|
ProtobufLogWriter() |
Modifier and Type | Method and Description |
---|---|
void |
append(WAL.Entry entry) |
void |
close() |
protected OutputStream |
getOutputStreamForCellEncoder() |
org.apache.hadoop.fs.FSDataOutputStream |
getStream() |
protected void |
initOutput(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
boolean overwritable,
int bufferSize,
short replication,
long blockSize) |
void |
sync(boolean forceSync) |
protected long |
writeMagicAndWALHeader(byte[] magic,
WALProtos.WALHeader header)
return the file length after written.
|
protected long |
writeWALTrailerAndMagic(WALProtos.WALTrailer trailer,
byte[] magic) |
buildSecureWALHeader, buildWALHeader, getLength, getWriterClassName, init, initAfterHeader, secureInitAfterHeader, setEncryptor, writeWALTrailer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
getLength
public void append(WAL.Entry entry) throws IOException
append
in interface WALProvider.Writer
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void sync(boolean forceSync) throws IOException
sync
in interface WALProvider.Writer
IOException
public org.apache.hadoop.fs.FSDataOutputStream getStream()
protected void initOutput(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, boolean overwritable, int bufferSize, short replication, long blockSize) throws IOException, CommonFSUtils.StreamLacksCapabilityException
initOutput
in class AbstractProtobufLogWriter
IOException
CommonFSUtils.StreamLacksCapabilityException
protected long writeMagicAndWALHeader(byte[] magic, WALProtos.WALHeader header) throws IOException
AbstractProtobufLogWriter
writeMagicAndWALHeader
in class AbstractProtobufLogWriter
IOException
protected OutputStream getOutputStreamForCellEncoder()
getOutputStreamForCellEncoder
in class AbstractProtobufLogWriter
protected long writeWALTrailerAndMagic(WALProtos.WALTrailer trailer, byte[] magic) throws IOException
writeWALTrailerAndMagic
in class AbstractProtobufLogWriter
IOException
Copyright © 2007–2019 Cloudera. All rights reserved.