Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2284#discussion_r158756282
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClient.java
---
@@ -166,6 +166,21 @@
*/
<K> boolean remove(K key, Serializer<K> serializer) throws IOException;
+ /**
+ * Removes the entry with the given key from the cache, if it is
present,
+ * and returns the value that was removed from the map.
+ *
+ * @param <K> type of key
+ * @param <V> type of value
+ * @param key key
+ * @param keySerializer key serializer
+ * @param valueDeserializer value deserializer
+ * @return the value previously associated with the key, or null if
there was no mapping
+ * null can also indicate that the map previously associated null with
the key
+ * @throws IOException ex
+ */
+ <K, V> V removeAndGet(K key, Serializer<K> keySerializer,
Deserializer<V> valueDeserializer) throws IOException;
--- End diff --
This new method should have a default implementation which throws
UnsupportedOperationException.
---