public interface DistributedMapCacheClient extends ControllerService
Map
.Modifier and Type | Method and Description |
---|---|
void |
close()
Attempts to notify the server that we are finished communicating with it
and cleans up resources
|
<K> boolean |
containsKey(K key,
Serializer<K> keySerializer)
Determines if the given value is present in the cache and if so returns
true , else returns false |
<K,V> V |
get(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer)
Returns the value in the cache for the given key, if one exists;
otherwise returns
null |
<K,V> V |
getAndPutIfAbsent(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer,
Deserializer<V> valueDeserializer)
Adds the specified key and value to the cache, if they are not already
present, serializing the key and value with the given
Serializer s. |
<K,V> boolean |
putIfAbsent(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
Adds the specified key and value to the cache, if they are not already
present, serializing the key and value with the given
Serializer s. |
<K> boolean |
remove(K key,
Serializer<K> serializer)
Removes the entry with the given key from the cache, if it is present.
|
initialize
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
<K,V> boolean putIfAbsent(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer) throws IOException
Serializer
s.K
- V
- key
- the key for into the mapvalue
- the value to add to the map if and only if the key is absentkeySerializer
- valueSerializer
- IOException
- if unable to communicate with the remote instance<K,V> V getAndPutIfAbsent(K key, V value, Serializer<K> keySerializer, Serializer<V> valueSerializer, Deserializer<V> valueDeserializer) throws IOException
Serializer
s. If a value already exists in the cache for the given
key, the value associated with the key is returned, after being
deserialized with the given valueDeserializer.K
- V
- key
- value
- keySerializer
- valueSerializer
- valueDeserializer
- IOException
<K> boolean containsKey(K key, Serializer<K> keySerializer) throws IOException
true
, else returns false
K
- key
- keySerializer
- IOException
- if unable to communicate with the remote instance<K,V> V get(K key, Serializer<K> keySerializer, Deserializer<V> valueDeserializer) throws IOException
null
K
- V
- key
- the key to lookup in the mapkeySerializer
- valueDeserializer
- IOException
void close() throws IOException
IOException
<K> boolean remove(K key, Serializer<K> serializer) throws IOException
K
- key
- serializer
- true
if the entry is removed, false
if
the key did not exist in the cacheIOException
Copyright © 2015 Apache NiFi (incubating). All rights reserved.