Package org.cache2k.io
Interface AsyncBulkCacheLoader.BulkCallback<K,V>
-
- All Superinterfaces:
DataAware<K,V>
- Enclosing interface:
- AsyncBulkCacheLoader<K,V>
public static interface AsyncBulkCacheLoader.BulkCallback<K,V> extends DataAware<K,V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
onLoadFailure(Iterable<? extends K> keys, Throwable exception)
Report exception for a set of keys.void
onLoadFailure(Throwable exception)
The load attempt resulted in an exception.void
onLoadFailure(K key, Throwable exception)
Report exception for a specific key.void
onLoadSuccess(Map<? extends K,? extends V> data)
The load was successful.void
onLoadSuccess(K key, V value)
A single key value tuple was loaded successfully.
-
-
-
Method Detail
-
onLoadSuccess
void onLoadSuccess(Map<? extends K,? extends V> data)
The load was successful. Per bulk request this method can be called multiple times to transfer partial results to the cache as soon as data is available.- Parameters:
data
- loaded data, either representing all requested keys or a partial result
-
onLoadSuccess
void onLoadSuccess(K key, V value)
A single key value tuple was loaded successfully. This method can be called multiple times to send all loaded values.
-
onLoadFailure
void onLoadFailure(Throwable exception)
The load attempt resulted in an exception. If partial results are returned viaonLoadSuccess(Map)
the exception is only processed for the remaining keys.The logic for exception handling, e.g. the `ResiliencePolicy` will be run for each entry individually. If the bulk operation was started on behalf a user cache operation, e.g.
Cache.loadAll(Iterable)
the exception will be propagated although the operation was partially successful. When called multiple times, only the first call has an effect and subsequent calls do nothing.
-
onLoadFailure
default void onLoadFailure(Iterable<? extends K> keys, Throwable exception)
Report exception for a set of keys. Rationale: An incoming bulk load request might be split and passed on as separate bulk requests, e.g. to meet some limits. One of these partial request might result in an error, the other might go through successful. In this case the exception should be propagated for the corresponding set of keys.Multiple calls with the same key have no effect.
-
-