org.apache.hadoop.hbase.regionserver.wal
Class ProtobufLogWriter

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.wal.WriterBase
      extended by org.apache.hadoop.hbase.regionserver.wal.ProtobufLogWriter
All Implemented Interfaces:
HLog.Writer
Direct Known Subclasses:
SecureProtobufLogWriter

@InterfaceAudience.LimitedPrivate(value="Configuration")
public class ProtobufLogWriter
extends WriterBase

Writer for protobuf-based WAL.


Field Summary
protected  Codec.Encoder cellEncoder
           
protected  WALCellCodec.ByteStringCompressor compressor
           
protected  org.apache.hadoop.fs.FSDataOutputStream output
           
 
Fields inherited from class org.apache.hadoop.hbase.regionserver.wal.WriterBase
compressionContext, conf
 
Constructor Summary
ProtobufLogWriter()
           
 
Method Summary
 void append(HLog.Entry entry)
           
protected  org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALHeader buildWALHeader(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALHeader.Builder builder)
           
protected  org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALTrailer buildWALTrailer(org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALTrailer.Builder builder)
           
 void close()
           
protected  WALCellCodec getCodec(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext)
           
 long getLength()
           
 org.apache.hadoop.fs.FSDataOutputStream getStream()
           
 void init(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, boolean overwritable)
           
protected  void initAfterHeader(boolean doCompress)
           
 void setWALTrailer(org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALTrailer walTrailer)
          Sets HLog's WALTrailer.
 void sync()
           
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.wal.WriterBase
initializeCompressionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

output

protected org.apache.hadoop.fs.FSDataOutputStream output

cellEncoder

protected Codec.Encoder cellEncoder

compressor

protected WALCellCodec.ByteStringCompressor compressor
Constructor Detail

ProtobufLogWriter

public ProtobufLogWriter()
Method Detail

getCodec

protected WALCellCodec getCodec(org.apache.hadoop.conf.Configuration conf,
                                org.apache.hadoop.hbase.regionserver.wal.CompressionContext compressionContext)
                         throws IOException
Throws:
IOException

buildWALHeader

protected org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALHeader buildWALHeader(org.apache.hadoop.conf.Configuration conf,
                                                                                        org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALHeader.Builder builder)
                                                                                 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)
          throws IOException
Specified by:
init in interface HLog.Writer
Overrides:
init in class WriterBase
Throws:
IOException

initAfterHeader

protected void initAfterHeader(boolean doCompress)
                        throws IOException
Throws:
IOException

append

public void append(HLog.Entry entry)
            throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException

buildWALTrailer

protected org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALTrailer buildWALTrailer(org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALTrailer.Builder builder)

sync

public void sync()
          throws IOException
Throws:
IOException

getLength

public long getLength()
               throws IOException
Throws:
IOException

getStream

public org.apache.hadoop.fs.FSDataOutputStream getStream()

setWALTrailer

public void setWALTrailer(org.apache.hadoop.hbase.protobuf.generated.WALProtos.WALTrailer walTrailer)
Description copied from interface: HLog.Writer
Sets HLog's WALTrailer. This trailer is appended at the end of WAL on closing.

Parameters:
walTrailer - trailer to append to WAL.


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.