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.SamePrefixComparator<T>, KeyValue.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate intprivate shortFields inherited from class org.apache.hadoop.hbase.KeyValue
bytes, COLUMN_FAMILY_DELIM_ARRAY, COLUMN_FAMILY_DELIMITER, FAMILY_LENGTH_SIZE, KEY_INFRASTRUCTURE_SIZE, KEY_LENGTH_SIZE, KEYVALUE_INFRASTRUCTURE_SIZE, KEYVALUE_WITH_TAGS_INFRASTRUCTURE_SIZE, length, LOWESTKEY, offset, ROW_KEY_OFFSET, ROW_LENGTH_SIZE, ROW_OFFSET, TAGS_LENGTH_SIZE, TIMESTAMP_SIZE, TIMESTAMP_TYPE_SIZE, TYPE_SIZEFields inherited from interface org.apache.hadoop.hbase.ExtendedCell
CELL_NOT_BASED_ON_CHUNKFields inherited from interface org.apache.hadoop.hbase.RawCell
MAX_TAGS_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionSizeCachedKeyValue(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 TypeMethodDescriptionintReturns Length of key portion.shortReturns Row lengthintOverride by just returning the length for saving cost of method dispatching.longheapSize()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, setSequenceId, setTimestamp, setTimestamp, shallowCopy, toString, toStringMap, updateLatestStamp, write, write, write, writeByteArrayMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.ExtendedCell
getChunkId, getType
-
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:KeyValueReturns Row length- Specified by:
getRowLengthin interfaceCell- Overrides:
getRowLengthin classKeyValue
-
getKeyLength
Description copied from class:KeyValueReturns Length of key portion.- Overrides:
getKeyLengthin classKeyValue
-
heapSize
Description copied from class:KeyValueHeapSize 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:
getSerializedSizein interfaceCell- Specified by:
getSerializedSizein interfaceExtendedCell- Overrides:
getSerializedSizein classKeyValue
-