@Tags(value={"distributed","client","cluster","map","cache"}) @CapabilityDescription(value="Provides the ability to communicate with a DistributedMapCacheServer. This allows multiple nodes to coordinate state with a single remote entity.") 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
Serializers. |
<K,V> void |
put(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
Adds the specified key and value to the cache, overwriting any value that is
currently set.
|
<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
Serializers. |
<K> boolean |
remove(K key,
Serializer<K> serializer)
Removes the entry with the given key from the cache, if it is present.
|
long |
removeByPattern(String regex)
Removes entries whose keys match the specified pattern
|
initializegetIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate<K,V> boolean putIfAbsent(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
throws IOException
Serializers.K - type of keyV - type of valuekey - the key for into the mapvalue - the value to add to the map if and only if the key is absentkeySerializer - key serializervalueSerializer - value serializerIOException - 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
Serializers. 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 - type of keyV - type of valuekey - keyvalue - valuekeySerializer - key serializervalueSerializer - key serializervalueDeserializer - value deserializerIOException - ex<K> boolean containsKey(K key,
Serializer<K> keySerializer)
throws IOException
true, else returns falseK - type of keykey - keykeySerializer - key serializertrue, else returns falseIOException - if unable to communicate with the remote instance<K,V> void put(K key,
V value,
Serializer<K> keySerializer,
Serializer<V> valueSerializer)
throws IOException
K - the key typeV - the value typekey - The key to setvalue - The value to associate with the given KeykeySerializer - the Serializer that will be used to serialize the key into bytesvalueSerializer - the Serializer that will be used to serialize the value into bytesIOException - if unable to communicate with the remote instanceNullPointerException - if the key or either serializer is null<K,V> V get(K key,
Serializer<K> keySerializer,
Deserializer<V> valueDeserializer)
throws IOException
nullK - the key typeV - the value typekey - the key to lookup in the mapkeySerializer - key serializervalueDeserializer - value serializernullIOException - exvoid close()
throws IOException
IOException - ex<K> boolean remove(K key,
Serializer<K> serializer)
throws IOException
K - type of keykey - keyserializer - serializertrue if the entry is removed, false if
the key did not exist in the cacheIOException - exlong removeByPattern(String regex) throws IOException
regex - The regular expression / pattern on which to match the keys to be removedIOException - if any error occurred while removing an entryCopyright © 2017 Apache NiFi Project. All rights reserved.