public class LoadingLookup extends LookupExtractor
OnHeapLoadingCache
is onheap backed by a Guava cache implementation, the second OffHeapLoadingCache
is 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, unapplyAll
public LoadingLookup(DataFetcher dataFetcher, LoadingCache<String,String> loadingCache, LoadingCache<String,List<String>> reverseLoadingCache)
public String apply(String key)
LookupExtractor
apply
in class LookupExtractor
key
- The value to apply the lookup to. May not be nullpublic List<String> unapply(String value)
LookupExtractor
unapply
in class LookupExtractor
value
- 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()
LookupExtractor
getCacheKey
in class LookupExtractor
Copyright © 2011–2017. All rights reserved.