@InterfaceAudience.Private public class AsyncProtobufLogWriter extends AbstractProtobufLogWriter implements AsyncFSWALProvider.AsyncWriter
| Modifier and Type | Class and Description |
|---|---|
private static class |
AsyncProtobufLogWriter.OutputStreamWrapper |
| Modifier and Type | Field and Description |
|---|---|
private OutputStream |
asyncOutputWrapper |
private Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> |
channelClass |
private org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup |
eventLoopGroup |
private static org.slf4j.Logger |
LOG |
private AsyncFSOutput |
output |
cellEncoder, compressionContext, compressor, conf, length, trailer, trailerWarnSize, trailerWritten| Constructor and Description |
|---|
AsyncProtobufLogWriter(org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup,
Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(WAL.Entry entry) |
void |
close() |
AsyncFSOutput |
getOutput() |
protected OutputStream |
getOutputStreamForCellEncoder() |
protected String |
getWriterClassName() |
protected void |
initOutput(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
boolean overwritable,
int bufferSize,
short replication,
long blockSize) |
CompletableFuture<Long> |
sync(boolean forceSync) |
private long |
write(Consumer<CompletableFuture<Long>> action) |
protected long |
writeMagicAndWALHeader(byte[] magic,
org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header)
return the file length after written.
|
protected long |
writeWALTrailerAndMagic(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer,
byte[] magic) |
buildSecureWALHeader, buildWALHeader, getLength, init, initAfterHeader, secureInitAfterHeader, setEncryptor, setWALTrailer, writeWALTrailerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitgetLengthprivate static final org.slf4j.Logger LOG
private final org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup
private final Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass
private AsyncFSOutput output
private OutputStream asyncOutputWrapper
public AsyncProtobufLogWriter(org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass)
protected String getWriterClassName()
getWriterClassName in class AbstractProtobufLogWriterpublic void append(WAL.Entry entry)
append in interface WALProvider.AsyncWriterpublic CompletableFuture<Long> sync(boolean forceSync)
sync in interface WALProvider.AsyncWriterpublic void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic AsyncFSOutput getOutput()
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 AbstractProtobufLogWriterIOExceptionCommonFSUtils.StreamLacksCapabilityExceptionprivate long write(Consumer<CompletableFuture<Long>> action) throws IOException
IOExceptionprotected long writeMagicAndWALHeader(byte[] magic, org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALHeader header) throws IOException
AbstractProtobufLogWriterwriteMagicAndWALHeader in class AbstractProtobufLogWriterIOExceptionprotected long writeWALTrailerAndMagic(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.WALTrailer trailer, byte[] magic) throws IOException
writeWALTrailerAndMagic in class AbstractProtobufLogWriterIOExceptionprotected OutputStream getOutputStreamForCellEncoder()
getOutputStreamForCellEncoder in class AbstractProtobufLogWriterCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.