Package org.apache.hadoop.hbase
Class SizeCachedKeyValue
java.lang.Object
org.apache.hadoop.hbase.KeyValue
org.apache.hadoop.hbase.SizeCachedKeyValue
- All Implemented Interfaces:
Cloneable
,Cell
,ExtendedCell
,HeapSize
,RawCell
- Direct Known Subclasses:
SizeCachedNoTagsKeyValue
This class is an extension to KeyValue where rowLen and keyLen are cached. Parsing the backing
byte[] every time to get these values will affect the performance. In read path, we tend to read
these values many times in Comparator, SQM etc. Note: Please do not use these objects in write
path as it will increase the heap space usage. See
https://issues.apache.org/jira/browse/HBASE-13448
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.KeyValue
KeyValue.KeyOnlyKeyValue, KeyValue.KVComparator, KeyValue.MetaComparator, KeyValue.SamePrefixComparator<T>, KeyValue.Type
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private int
private short
Fields inherited from class org.apache.hadoop.hbase.KeyValue
bytes, COLUMN_FAMILY_DELIM_ARRAY, COLUMN_FAMILY_DELIMITER, COMPARATOR, FAMILY_LENGTH_SIZE, KEY_INFRASTRUCTURE_SIZE, KEY_LENGTH_SIZE, KEYVALUE_INFRASTRUCTURE_SIZE, KEYVALUE_WITH_TAGS_INFRASTRUCTURE_SIZE, length, LOWESTKEY, META_COMPARATOR, offset, ROW_KEY_OFFSET, ROW_LENGTH_SIZE, ROW_OFFSET, TAGS_LENGTH_SIZE, TIMESTAMP_SIZE, TIMESTAMP_TYPE_SIZE, TYPE_SIZE
Fields inherited from interface org.apache.hadoop.hbase.ExtendedCell
CELL_NOT_BASED_ON_CHUNK
Fields inherited from interface org.apache.hadoop.hbase.RawCell
MAX_TAGS_LENGTH
-
Constructor Summary
ConstructorDescriptionSizeCachedKeyValue
(byte[] bytes, int offset, int length, long seqId, int keyLen) SizeCachedKeyValue
(byte[] bytes, int offset, int length, long seqId, int keyLen, short rowLen) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns Length of key portion.short
Returns Row lengthint
Override by just returning the length for saving cost of method dispatching.long
heapSize()
HeapSize implementationMethods inherited from class org.apache.hadoop.hbase.KeyValue
checkParameters, clone, create, create, createKeyOnly, deepClone, equals, getBuffer, getDelimiter, getDelimiterInReverse, getFamilyArray, getFamilyLength, getFamilyLength, getFamilyLengthPosition, getFamilyOffset, getFamilyOffset, getKey, getKeyDataStructureSize, getKeyOffset, getKeyString, getKeyValueDataStructureSize, getKeyValueDataStructureSize, getKeyValueDataStructureSize, getLength, getOffset, getQualifierArray, getQualifierLength, getQualifierLength, getQualifierOffset, getQualifierOffset, getRowArray, getRowOffset, getSequenceId, getSerializedSize, getTagsArray, getTagsLength, getTagsOffset, getTimestamp, getTimestamp, getTimestampOffset, getTypeByte, getTypeByte, getValueArray, getValueLength, getValueOffset, hashCode, humanReadableTimestamp, isLatestTimestamp, keyToString, keyToString, oswrite, setSequenceId, setTimestamp, setTimestamp, shallowCopy, toString, toStringMap, updateLatestStamp, write, write, write, writeByteArray
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.ExtendedCell
getChunkId
-
Field Details
-
FIXED_OVERHEAD
- See Also:
-
rowLen
-
keyLen
-
-
Constructor Details
-
SizeCachedKeyValue
-
SizeCachedKeyValue
public SizeCachedKeyValue(byte[] bytes, int offset, int length, long seqId, int keyLen, short rowLen)
-
-
Method Details
-
getRowLength
Description copied from class:KeyValue
Returns Row length- Specified by:
getRowLength
in interfaceCell
- Overrides:
getRowLength
in classKeyValue
-
getKeyLength
Description copied from class:KeyValue
Returns Length of key portion.- Overrides:
getKeyLength
in classKeyValue
-
heapSize
Description copied from class:KeyValue
HeapSize implementation We do not count the bytes in the rowCache because it should be empty for a KeyValue in the MemStore. -
getSerializedSize
Override by just returning the length for saving cost of method dispatching. If not, it will callExtendedCell.getSerializedSize()
firstly, then forward toKeyValue.getSerializedSize(boolean)
. (See HBASE-21657)- Specified by:
getSerializedSize
in interfaceCell
- Specified by:
getSerializedSize
in interfaceExtendedCell
- Overrides:
getSerializedSize
in classKeyValue
-