Package org.apache.hadoop.hbase.io.hfile
Class NoOpDataBlockEncoder
java.lang.Object
org.apache.hadoop.hbase.io.hfile.NoOpDataBlockEncoder
- All Implemented Interfaces:
HFileDataBlockEncoder
Does not perform any kind of encoding/decoding.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder
DATA_BLOCK_ENCODING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencode(ExtendedCell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) Encodes a KeyValue.voidendBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader, BlockType blockType) Ends encoding for a block of KeyValues.Returns the data block encodinggetEffectiveEncodingInCache(boolean isCompaction) newDataBlockDecodingContext(org.apache.hadoop.conf.Configuration conf, HFileContext meta) create a encoder specific decoding context for reading.newDataBlockEncodingContext(org.apache.hadoop.conf.Configuration conf, byte[] dummyHeader, HFileContext meta) Create an encoder specific encoding context object for writing.voidsaveMetadata(HFile.Writer writer) Save metadata in HFile which will be written to diskvoidstartBlockEncoding(HFileBlockEncodingContext blkEncodingCtx, DataOutputStream out) Starts encoding for a block of KeyValues.toString()booleanDecides whether we should use a scanner over encoded blocks.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NoOpDataBlockEncoder
private NoOpDataBlockEncoder()Cannot be instantiated. UseINSTANCEinstead.
-
-
Method Details
-
encode
public void encode(ExtendedCell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException Description copied from interface:HFileDataBlockEncoderEncodes a KeyValue.- Specified by:
encodein interfaceHFileDataBlockEncoder- Throws:
IOException
-
useEncodedScanner
Description copied from interface:HFileDataBlockEncoderDecides whether we should use a scanner over encoded blocks.- Specified by:
useEncodedScannerin interfaceHFileDataBlockEncoder- Returns:
- Whether to use encoded scanner.
-
saveMetadata
Description copied from interface:HFileDataBlockEncoderSave metadata in HFile which will be written to disk- Specified by:
saveMetadatain interfaceHFileDataBlockEncoder- Parameters:
writer- writer for a given HFile
-
getDataBlockEncoding
Description copied from interface:HFileDataBlockEncoderReturns the data block encoding- Specified by:
getDataBlockEncodingin interfaceHFileDataBlockEncoder
-
getEffectiveEncodingInCache
- Specified by:
getEffectiveEncodingInCachein interfaceHFileDataBlockEncoder- Returns:
- the effective in-cache data block encoding, taking into account whether we are doing a compaction.
-
toString
-
newDataBlockEncodingContext
public HFileBlockEncodingContext newDataBlockEncodingContext(org.apache.hadoop.conf.Configuration conf, byte[] dummyHeader, HFileContext meta) Description copied from interface:HFileDataBlockEncoderCreate an encoder specific encoding context object for writing. And the encoding context should also perform compression if compressionAlgorithm is valid.- Specified by:
newDataBlockEncodingContextin interfaceHFileDataBlockEncoder- Parameters:
conf- store configurationdummyHeader- header bytesmeta- HFile meta data- Returns:
- a new
HFileBlockEncodingContextobject
-
newDataBlockDecodingContext
public HFileBlockDecodingContext newDataBlockDecodingContext(org.apache.hadoop.conf.Configuration conf, HFileContext meta) Description copied from interface:HFileDataBlockEncodercreate a encoder specific decoding context for reading. And the decoding context should also do decompression if compressionAlgorithm is valid.- Specified by:
newDataBlockDecodingContextin interfaceHFileDataBlockEncoder- Parameters:
conf- store configurationmeta- - HFile meta data- Returns:
- a new
HFileBlockDecodingContextobject
-
startBlockEncoding
public void startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx, DataOutputStream out) throws IOException Description copied from interface:HFileDataBlockEncoderStarts encoding for a block of KeyValues. CallHFileDataBlockEncoder.endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[], BlockType)to finish encoding of a block.- Specified by:
startBlockEncodingin interfaceHFileDataBlockEncoder- Throws:
IOException
-
endBlockEncoding
public void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader, BlockType blockType) throws IOException Description copied from interface:HFileDataBlockEncoderEnds encoding for a block of KeyValues. Gives a chance for the encoder to do the finishing stuff for the encoded block. It must be called at the end of block encoding.- Specified by:
endBlockEncodingin interfaceHFileDataBlockEncoder- Throws:
IOException
-