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
-
Field Summary
Fields inherited from interface org.apache.hadoop.hbase.io.hfile.HFileDataBlockEncoder
DATA_BLOCK_ENCODING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(ExtendedCell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) Encodes a KeyValue.void
endBlockEncoding
(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.void
saveMetadata
(HFile.Writer writer) Save metadata in HFile which will be written to diskvoid
startBlockEncoding
(HFileBlockEncodingContext blkEncodingCtx, DataOutputStream out) Starts encoding for a block of KeyValues.toString()
boolean
Decides whether we should use a scanner over encoded blocks.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NoOpDataBlockEncoder
private NoOpDataBlockEncoder()Cannot be instantiated. UseINSTANCE
instead.
-
-
Method Details
-
encode
public void encode(ExtendedCell cell, HFileBlockEncodingContext encodingCtx, DataOutputStream out) throws IOException Description copied from interface:HFileDataBlockEncoder
Encodes a KeyValue.- Specified by:
encode
in interfaceHFileDataBlockEncoder
- Throws:
IOException
-
useEncodedScanner
Description copied from interface:HFileDataBlockEncoder
Decides whether we should use a scanner over encoded blocks.- Specified by:
useEncodedScanner
in interfaceHFileDataBlockEncoder
- Returns:
- Whether to use encoded scanner.
-
saveMetadata
Description copied from interface:HFileDataBlockEncoder
Save metadata in HFile which will be written to disk- Specified by:
saveMetadata
in interfaceHFileDataBlockEncoder
- Parameters:
writer
- writer for a given HFile
-
getDataBlockEncoding
Description copied from interface:HFileDataBlockEncoder
Returns the data block encoding- Specified by:
getDataBlockEncoding
in interfaceHFileDataBlockEncoder
-
getEffectiveEncodingInCache
- Specified by:
getEffectiveEncodingInCache
in 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: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 interfaceHFileDataBlockEncoder
- Parameters:
conf
- store configurationdummyHeader
- header bytesmeta
- HFile meta data- Returns:
- a new
HFileBlockEncodingContext
object
-
newDataBlockDecodingContext
public HFileBlockDecodingContext newDataBlockDecodingContext(org.apache.hadoop.conf.Configuration conf, 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 interfaceHFileDataBlockEncoder
- Parameters:
conf
- store configurationmeta
- - HFile meta data- Returns:
- a new
HFileBlockDecodingContext
object
-
startBlockEncoding
public void startBlockEncoding(HFileBlockEncodingContext blkEncodingCtx, DataOutputStream out) throws IOException Description copied from interface:HFileDataBlockEncoder
Starts encoding for a block of KeyValues. CallHFileDataBlockEncoder.endBlockEncoding(HFileBlockEncodingContext, DataOutputStream, byte[], BlockType)
to finish encoding of a block.- Specified by:
startBlockEncoding
in interfaceHFileDataBlockEncoder
- Throws:
IOException
-
endBlockEncoding
public void endBlockEncoding(HFileBlockEncodingContext encodingCtx, DataOutputStream out, byte[] uncompressedBytesWithHeader, BlockType blockType) throws IOException Description copied from interface:HFileDataBlockEncoder
Ends 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:
endBlockEncoding
in interfaceHFileDataBlockEncoder
- Throws:
IOException
-