org.apache.hadoop.hbase.io.hfile
Class NoOpDataBlockEncoder

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.NoOpDataBlockEncoder
All Implemented Interfaces:
HFileDataBlockEncoder

@InterfaceAudience.Private
public class NoOpDataBlockEncoder
extends Object
implements HFileDataBlockEncoder

Does not perform any kind of encoding/decoding.


Field Summary
static NoOpDataBlockEncoder INSTANCE
           
 
Fields inherited from interface org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder
DATA_BLOCK_ENCODING
 
Method Summary
 void beforeWriteToDisk(ByteBuffer in, HFileBlockEncodingContext encodeCtx, BlockType blockType)
          Should be called before an encoded or unencoded data block is written to disk.
 DataBlockEncoding getDataBlockEncoding()
           
 HFileBlockDecodingContext newDataBlockDecodingContext(HFileContext meta)
          create a encoder specific decoding context for reading.
 HFileBlockEncodingContext newDataBlockEncodingContext(byte[] dummyHeader, HFileContext meta)
          Create an encoder specific encoding context object for writing.
 void saveMetadata(HFile.Writer writer)
          Save metadata in HFile which will be written to disk
 String toString()
           
 boolean useEncodedScanner()
          Decides whether we should use a scanner over encoded blocks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final NoOpDataBlockEncoder INSTANCE
Method Detail

beforeWriteToDisk

public void beforeWriteToDisk(ByteBuffer in,
                              HFileBlockEncodingContext encodeCtx,
                              BlockType blockType)
                       throws IOException
Description copied from interface: HFileDataBlockEncoder
Should be called before an encoded or unencoded data block is written to disk.

Specified by:
beforeWriteToDisk in interface HFileDataBlockEncoder
Parameters:
in - KeyValues next to each other
encodeCtx - the encoded result
blockType - block type
Throws:
IOException

useEncodedScanner

public boolean useEncodedScanner()
Description copied from interface: HFileDataBlockEncoder
Decides whether we should use a scanner over encoded blocks.

Specified by:
useEncodedScanner in interface HFileDataBlockEncoder
Returns:
Whether to use encoded scanner.

saveMetadata

public void saveMetadata(HFile.Writer writer)
Description copied from interface: HFileDataBlockEncoder
Save metadata in HFile which will be written to disk

Specified by:
saveMetadata in interface HFileDataBlockEncoder
Parameters:
writer - writer for a given HFile

getDataBlockEncoding

public DataBlockEncoding getDataBlockEncoding()
Specified by:
getDataBlockEncoding in interface HFileDataBlockEncoder
Returns:
the data block encoding

toString

public String toString()
Overrides:
toString in class Object

newDataBlockEncodingContext

public HFileBlockEncodingContext newDataBlockEncodingContext(byte[] dummyHeader,
                                                             HFileContext meta)
Description copied from interface: HFileDataBlockEncoder
Create an encoder specific encoding context object for writing. And the encoding context should also perform compression if compressionAlgorithm is valid.

Specified by:
newDataBlockEncodingContext in interface HFileDataBlockEncoder
Parameters:
dummyHeader - header bytes
meta - HFile meta data
Returns:
a new HFileBlockEncodingContext object

newDataBlockDecodingContext

public HFileBlockDecodingContext newDataBlockDecodingContext(HFileContext meta)
Description copied from interface: HFileDataBlockEncoder
create a encoder specific decoding context for reading. And the decoding context should also do decompression if compressionAlgorithm is valid.

Specified by:
newDataBlockDecodingContext in interface HFileDataBlockEncoder
Parameters:
meta - - HFile meta data
Returns:
a new HFileBlockDecodingContext object


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.