Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2284#discussion_r158756291
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-client-service-api/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClient.java
---
@@ -174,4 +189,28 @@
* @throws IOException if any error occurred while removing an entry
*/
long removeByPattern(String regex) throws IOException;
+
+ /**
+ * Removes entries whose keys match the specified pattern, and returns
a map of entries that
+ * were removed.
+ *
+ * @param <K> type of key
+ * @param <V> type of value
+ * @param regex The regular expression / pattern on which to match the
keys to be removed
+ * @param keyDeserializer key deserializer
+ * @param valueDeserializer value deserializer
+ * @return A map of key/value entries that were removed from the cache
+ * @throws IOException if any error occurred while removing an entry
+ */
+ <K, V> Map<K, V> removeByPatternAndGet(String regex, Deserializer<K>
keyDeserializer, Deserializer<V> valueDeserializer) throws IOException;
--- End diff --
This new method should have a default implementation which throws
UnsupportedOperationException.
---