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>
-
public class ThreadLocalBatchData<D> extends PersistentThreadLocal<List<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
Constructors Constructor Description ThreadLocalBatchData()
ThreadLocalBatchData(int numThreads)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addElement(D value)
protected void
getAndThen(Consumer<List<D>> dataConsumer)
Collection<D>
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
-
-
-
-
Method Detail
-
ofEntry
public static <K,V> ThreadLocalBatchData<Map.Entry<? extends K,? extends V>> ofEntry()
-
ofEntry
public static <K,V> ThreadLocalBatchData<Map.Entry<? extends K,? extends V>> ofEntry(int parallelism)
-
ofAny
public static ThreadLocalBatchData<?> ofAny(int parallelism)
-
ofAny
public static ThreadLocalBatchData<?> ofAny()
-
getBatch
public Collection<D> getBatch()
-
addElement
public void addElement(D value)
-
removeElement
public void removeElement(D value)
-
-