public class LoadingLookup extends LookupExtractor
OnHeapLoadingCacheis onheap backed by a Guava cache implementation, the second OffHeapLoadingCacheis MapDB offheap implementation.
Both implementations offer various eviction strategies.| Constructor and Description |
|---|
LoadingLookup(DataFetcher dataFetcher,
LoadingCache<String,String> loadingCache,
LoadingCache<String,List<String>> reverseLoadingCache) |
| Modifier and Type | Method and Description |
|---|---|
String |
apply(String key)
Apply a particular lookup methodology to the input string
|
void |
close() |
byte[] |
getCacheKey()
Create a cache key for use in results caching
|
boolean |
isOpen() |
List<String> |
unapply(String value)
Provide the reverse mapping from a given value to a list of keys
|
applyAll, isOneToOne, unapplyAllpublic LoadingLookup(DataFetcher dataFetcher, LoadingCache<String,String> loadingCache, LoadingCache<String,List<String>> reverseLoadingCache)
public String apply(String key)
LookupExtractorapply in class LookupExtractorkey - The value to apply the lookup to. May not be nullpublic List<String> unapply(String value)
LookupExtractorunapply in class LookupExtractorvalue - the value to apply the reverse lookup
Null and empty are considered to be the same value = nullToEmpty(value)public void close()
public boolean isOpen()
public byte[] getCacheKey()
LookupExtractorgetCacheKey in class LookupExtractorCopyright © 2011–2017. All rights reserved.