| 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() |
ByteBuffer |
get(ByteBuffer key) |
MapPutResult |
put(ByteBuffer key,
ByteBuffer value) |
MapPutResult |
putIfAbsent(ByteBuffer key,
ByteBuffer value) |
ByteBuffer |
remove(ByteBuffer key) |
void |
shutdown() |
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 MapCachepublic MapPutResult put(ByteBuffer key, ByteBuffer value)
public boolean containsKey(ByteBuffer key)
containsKey in interface MapCachepublic ByteBuffer get(ByteBuffer key)
public ByteBuffer remove(ByteBuffer key) throws IOException
remove in interface MapCacheIOExceptionpublic void shutdown()
throws IOException
shutdown in interface MapCacheIOExceptionCopyright © 2015 Apache NiFi Project. All rights reserved.