Class ConcurrentIndexCache<T>
java.lang.Object
io.nosqlbench.adapters.api.activityimpl.uniform.ConcurrentIndexCache<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Iterable<T>
This cache implementation packs referents into an atomic array, keeping things as compact as possible, allowing auto-resizing, size tracking, and supporting concurrent access with minimal locking. It also uses a bitset to track the referent indices for enumeration or traversal.
In order to protect against unexpected OOM scenarios, the maximum index is defaulted to 1000000. If you want to have index caches bigger than this, pass ina higher limit.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConcurrentIndexCache(String label) ConcurrentIndexCache(String label, LongFunction<T> valueLoader) ConcurrentIndexCache(String label, LongFunction<T> valueLoader, int maxIndex) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ConcurrentIndexCache
-
ConcurrentIndexCache
-
ConcurrentIndexCache
-
-
Method Details
-
get
-
get
-
remove
-
clear
public void clear() -
iterator
-
size
public int size()
-