Package herddb.index.blink
Interface BLink.SizeEvaluator<X,Y>
-
- Enclosing class:
- BLink<K extends Comparable<K>,V>
public static interface BLink.SizeEvaluator<X,Y>Support structure to evaluates memory byte size occupancy of keys and values- Author:
- diego.salvi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default longconstantKeySize()Returns constant key size if key size doesn't changes.default longconstantValueSize()Returns constant value size if value size doesn't changes.longevaluateAll(X key, Y value)Evaluate both key and value sizelongevaluateKey(X key)Evaluate the key size onlylongevaluateValue(Y value)Evaluate the value size onlyXgetPosiviveInfinityKey()Returns a value which is greater than all of the other values.default booleanisKeySizeConstant()Check if handled keys have a constant byte size or it changes from key to key.default booleanisValueSizeConstant()Check if handled value have a constant byte size or it changes from value to value.
-
-
-
Method Detail
-
evaluateKey
long evaluateKey(X key)
Evaluate the key size only
-
evaluateValue
long evaluateValue(Y value)
Evaluate the value size only
-
isKeySizeConstant
default boolean isKeySizeConstant()
Check if handled keys have a constant byte size or it changes from key to key.- Returns:
trueif key size is constant,falseotherwise
-
constantKeySize
default long constantKeySize() throws UnsupportedOperationExceptionReturns constant key size if key size doesn't changes.- Returns:
- constant key size
- Throws:
UnsupportedOperationException- if key size isn't constant- See Also:
isKeySizeConstant()
-
isValueSizeConstant
default boolean isValueSizeConstant()
Check if handled value have a constant byte size or it changes from value to value.- Returns:
trueif value size is constant,falseotherwise
-
constantValueSize
default long constantValueSize() throws UnsupportedOperationExceptionReturns constant value size if value size doesn't changes.- Returns:
- constant value size
- Throws:
UnsupportedOperationException- if value size isn't constant- See Also:
isValueSizeConstant()
-
getPosiviveInfinityKey
X getPosiviveInfinityKey()
Returns a value which is greater than all of the other values. Code will check using '==', so this value must be a singleton.- Returns:
- a value which is greater than every other value
-
-