Package org.infinispan.container.entries
Class CacheEntrySizeCalculator<K,V>
java.lang.Object
org.infinispan.commons.util.AbstractEntrySizeCalculatorHelper<K,InternalCacheEntry<K,V>>
org.infinispan.container.entries.CacheEntrySizeCalculator<K,V>
- Type Parameters:
K
- The type of the keyV
- The type of the value
- All Implemented Interfaces:
EntrySizeCalculator<K,
,InternalCacheEntry<K, V>> KeyValueMetadataSizeCalculator<K,
V>
public class CacheEntrySizeCalculator<K,V>
extends AbstractEntrySizeCalculatorHelper<K,InternalCacheEntry<K,V>>
implements KeyValueMetadataSizeCalculator<K,V>
Implementation of a size calculator that calculates only the size of the value assuming it is an InternalCacheEntry.
This delegates the calculation of the key and the value contained within the InternalCacheEntry to the provided
SizeCalculator.
- Since:
- 8.0
- Author:
- William Burns
-
Field Summary
Fields inherited from class org.infinispan.commons.util.AbstractEntrySizeCalculatorHelper
HEADER_AND_CLASS_REFERENCE, OBJECT_SIZE, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionCacheEntrySizeCalculator
(EntrySizeCalculator<? super K, ? super V> calculator) -
Method Summary
Modifier and TypeMethodDescriptionlong
calculateSize
(K key, InternalCacheEntry<K, V> ice) Method used to calculate how much memory in size the key and value use.long
calculateSize
(K key, V value, Metadata metadata, PrivateMetadata pvtMetadata) Method used to calculate how much memory in size the key, value and metadata use.Methods inherited from class org.infinispan.commons.util.AbstractEntrySizeCalculatorHelper
roundUpToNearest8
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.infinispan.container.impl.KeyValueMetadataSizeCalculator
calculateSize
-
Constructor Details
-
CacheEntrySizeCalculator
-
-
Method Details
-
calculateSize
Description copied from interface:EntrySizeCalculator
Method used to calculate how much memory in size the key and value use.- Specified by:
calculateSize
in interfaceEntrySizeCalculator<K,
V> - Parameters:
key
- The key for this entry to be used in size calculationice
- The value for this entry to be used in size calculation- Returns:
- The size approximately in memory the key and value use
-
calculateSize
Description copied from interface:KeyValueMetadataSizeCalculator
Method used to calculate how much memory in size the key, value and metadata use.- Specified by:
calculateSize
in interfaceKeyValueMetadataSizeCalculator<K,
V> - Parameters:
key
- The key for this entry to be used in size calculationvalue
- The value for this entry to be used in size calculationmetadata
- The metadata for this entry to be used in size calculationpvtMetadata
- The internal metadata for this entry to be used in size calculation- Returns:
- The size approximately in memory the key, value and metadata use.
-