Package org.aksw.commons.rx.lookup
Interface LookupService<K,V>
- Type Parameters:
K-V-
- All Known Implementing Classes:
LookupServiceAddAbsentKeys,LookupServiceCacheMem,LookupServiceFilterKey,LookupServiceFlowableTransformer,LookupServiceFromMapService,LookupServicePartition,LookupServiceTransformKey,LookupServiceTransformKey2,LookupServiceTransformValue
public interface LookupService<K,V>
extends Function<Iterable<K>,io.reactivex.rxjava3.core.Flowable<Map.Entry<K,V>>>
A lookup service builds a cold flowable that upon execution retrieves data for the given set of keys.
-
Method Summary
Modifier and TypeMethodDescriptiondefault LookupService<K,V> cache()default LookupService<K,V> cache(com.google.common.cache.Cache<K, Optional<V>> hitCache, com.google.common.cache.Cache<K, Object> missCache) default LookupService<K,V> defaultForAbsentKeys(Function<? super K, ? extends V> defaultValueGenerator) default VA convenience short-hand for fetching a map by first mapping the keys to proxy keys.default LookupService<K,V> filterKeys(Predicate<? super K> filter) default <I> LookupService<I,V> default <W> LookupService<K,W> mapNonNullValues(BiFunction<K, V, W> fn) default <W> LookupService<K,W> mapNonNullValues(Function<V, W> fn) Passes non-null values on to the given function.default <W> LookupService<K,W> mapValues(BiFunction<K, V, W> fn) default <W> LookupService<K,W> default LookupService<K,V> partition(int k) requestList(Iterable<K> keys) requestMap(Iterable<K> keys) Requests a map.
-
Method Details
-
fetchItem
-
partition
-
filterKeys
-
mapValues
-
mapNonNullValues
Passes non-null values on to the given function. Nulls are internally mapped to null. -
mapValues
-
mapNonNullValues
-
mapKeys
-
defaultForAbsentKeys
-
cache
-
cache
-
requestMap
Requests a map. The 'Single' result type can be seen as representing the request.- Parameters:
keys-- Returns:
-
fetchMap
-
requestList
-
fetchList
-
fetchMap
A convenience short-hand for fetching a map by first mapping the keys to proxy keys. Equivalent tothis.
mapKeys(keyMapper).fetchMap(keys) - Type Parameters:
X-- Parameters:
keys-keyToProxy-- Returns:
-