Class ThreadLocalBatchData<D>
java.lang.Object
java.lang.ThreadLocal<T>
org.eclipse.epsilon.common.concurrent.PersistentThreadLocal<List<D>>
org.eclipse.epsilon.common.concurrent.ThreadLocalBatchData<D>
Convenience class for storing collections of thread-local data.
- Since:
- 1.6
- Author:
- Sina Madani
-
Field Summary
Fields inherited from class org.eclipse.epsilon.common.concurrent.PersistentThreadLocal
allValues, valueGetter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(D value) protected void
getAndThen
(Consumer<List<D>> dataConsumer) getBatch()
static ThreadLocalBatchData<?>
ofAny()
static ThreadLocalBatchData<?>
ofAny
(int parallelism) static <K,
V> ThreadLocalBatchData<Map.Entry<? extends K, ? extends V>> ofEntry()
static <K,
V> ThreadLocalBatchData<Map.Entry<? extends K, ? extends V>> ofEntry
(int parallelism) void
removeElement
(D value) void
updateElement
(D oldValue, D newValue) Methods inherited from class org.eclipse.epsilon.common.concurrent.PersistentThreadLocal
getAll, initialValue, remove, removeAll, set, size
Methods inherited from class java.lang.ThreadLocal
get, withInitial
-
Constructor Details
-
ThreadLocalBatchData
public ThreadLocalBatchData() -
ThreadLocalBatchData
public ThreadLocalBatchData(int numThreads)
-
-
Method Details
-
ofEntry
-
ofEntry
public static <K,V> ThreadLocalBatchData<Map.Entry<? extends K,? extends V>> ofEntry(int parallelism) -
ofAny
-
ofAny
-
getBatch
-
addElement
-
removeElement
-
updateElement
-
getAndThen
-