K
- Keys typeV
- Values typepublic interface DataFetcher<K,V>
Modifier and Type | Method and Description |
---|---|
Iterable<Map.Entry<K,V>> |
fetch(Iterable<K> keys)
Function used to perform a bulk lookup
|
V |
fetch(K key)
Function to perform a one item lookup.
|
Iterable<Map.Entry<K,V>> |
fetchAll()
Function used to fetch all the pair of key-values from the lookup
One use case of this method is to populate a polling cache
PollingCache |
List<K> |
reverseFetchKeys(V value)
Function used to perform reverse lookup
|
Iterable<Map.Entry<K,V>> fetchAll()
PollingCache
Iterable
of key-value pairs.@Nullable V fetch(K key)
key
- non-null key used to lookup the valueIterable<Map.Entry<K,V>> fetch(Iterable<K> keys)
keys
- used to lookup the respective valuesIterable
containing the pair of existing key-value.List<K> reverseFetchKeys(V value)
value
- use to fetch it's keys from the lookup tablevalue
or an empty list Collections.EmptyList
Copyright © 2011–2017. All rights reserved.