| Modifier and Type | Field and Description |
|---|---|
private Map<ByteBuffer,MapCacheRecord> |
cache |
private SortedMap<MapCacheRecord,ByteBuffer> |
inverseCacheMap |
private static org.slf4j.Logger |
logger |
private int |
maxSize |
private Lock |
readLock |
private ReadWriteLock |
rwLock |
private String |
serviceIdentifier |
private Lock |
writeLock |
| Constructor and Description |
|---|
SimpleMapCache(String serviceIdentifier,
int maxSize,
EvictionPolicy evictionPolicy) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(ByteBuffer key) |
private MapCacheRecord |
evict() |
MapCacheRecord |
fetch(ByteBuffer key) |
ByteBuffer |
get(ByteBuffer key) |
Set<ByteBuffer> |
keySet() |
MapPutResult |
put(ByteBuffer key,
ByteBuffer value) |
private MapPutResult |
put(ByteBuffer key,
ByteBuffer value,
MapCacheRecord existing) |
MapPutResult |
putIfAbsent(ByteBuffer key,
ByteBuffer value) |
ByteBuffer |
remove(ByteBuffer key) |
Map<ByteBuffer,ByteBuffer> |
removeByPattern(String regex) |
MapPutResult |
replace(MapCacheRecord inputRecord) |
void |
shutdown() |
Map<ByteBuffer,ByteBuffer> |
subMap(List<ByteBuffer> keys) |
String |
toString() |
private static final org.slf4j.Logger logger
private final Map<ByteBuffer,MapCacheRecord> cache
private final SortedMap<MapCacheRecord,ByteBuffer> inverseCacheMap
private final ReadWriteLock rwLock
private final Lock readLock
private final Lock writeLock
private final String serviceIdentifier
private final int maxSize
public SimpleMapCache(String serviceIdentifier, int maxSize, EvictionPolicy evictionPolicy)
private MapCacheRecord evict()
public MapPutResult putIfAbsent(ByteBuffer key, ByteBuffer value)
putIfAbsent in interface MapCacheprivate MapPutResult put(ByteBuffer key, ByteBuffer value, MapCacheRecord existing)
public MapPutResult put(ByteBuffer key, ByteBuffer value) throws IOException
put in interface MapCacheIOExceptionpublic boolean containsKey(ByteBuffer key)
containsKey in interface MapCachepublic ByteBuffer get(ByteBuffer key)
public Map<ByteBuffer,ByteBuffer> subMap(List<ByteBuffer> keys) throws IOException
subMap in interface MapCacheIOExceptionpublic ByteBuffer remove(ByteBuffer key) throws IOException
remove in interface MapCacheIOExceptionpublic Map<ByteBuffer,ByteBuffer> removeByPattern(String regex) throws IOException
removeByPattern in interface MapCacheIOExceptionpublic MapCacheRecord fetch(ByteBuffer key) throws IOException
fetch in interface MapCacheIOExceptionpublic MapPutResult replace(MapCacheRecord inputRecord) throws IOException
replace in interface MapCacheIOExceptionpublic Set<ByteBuffer> keySet() throws IOException
keySet in interface MapCacheIOExceptionpublic void shutdown()
throws IOException
shutdown in interface MapCacheIOExceptionCopyright © 2021 Apache NiFi Project. All rights reserved.