| Modifier and Type | Class and Description |
|---|---|
static class |
BatchImpl.BatchEntry<T> |
static class |
BatchImpl.BatchPromise<T>
Internal Promise delegate that decouples setting value on internal Promise from
publishing result on external promise.
|
| Modifier and Type | Method and Description |
|---|---|
int |
batchSize()
Returns size of this batch.
|
void |
done(K key,
T value)
Completes a
Promise associated with given key with
a value. |
Set<Map.Entry<K,BatchImpl.BatchEntry<T>>> |
entries() |
void |
fail(K key,
Throwable error)
Fails a
Promise associated with given key with
an error. |
int |
failAll(Throwable error)
Fails all promises belonging to this batch with given error.
|
void |
foreach(BiConsumer<K,com.linkedin.parseq.promise.SettablePromise<T>> consumer)
Performs the given action for each element of the batch
until all elements have been processed or the action throws an
exception.
|
Set<K> |
keys()
Returns set of keys belonging to this batch.
|
int |
keySize()
Returns number of keys belonging to this batch.
|
String |
toString() |
Collection<BatchImpl.BatchEntry<T>> |
values() |
public void done(K key, T value) throws com.linkedin.parseq.promise.PromiseResolvedException
BatchPromise associated with given key with
a value.
Throws PromiseResolvedException if Promise associated with given key has already been resolved.public void fail(K key, Throwable error) throws com.linkedin.parseq.promise.PromiseResolvedException
BatchPromise associated with given key with
an error.
Throws PromiseResolvedException if Promise associated with given key has already been resolved.public int failAll(Throwable error)
BatchfailAll in interface Batch<K,T>error - error that all promises belonging to this batch will be failed with0 it means that it successfully failed all promises belonging to this batch with
specified errorpublic Set<K> keys()
Batchpublic void foreach(BiConsumer<K,com.linkedin.parseq.promise.SettablePromise<T>> consumer)
Batchpublic Collection<BatchImpl.BatchEntry<T>> values()
public Set<Map.Entry<K,BatchImpl.BatchEntry<T>>> entries()
public int keySize()
Batchpublic int batchSize()
BatchBatchingStrategy.keySize(Object, Object) is
defined.Copyright © 2018. All rights reserved.