[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2018-01-05 Thread Michael Moser (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16313813#comment-16313813
 ] 

Michael Moser commented on NIFI-4504:
-

I'm a bit late, but thank you Koji for reviewing this!

> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
> Fix For: 1.5.0
>
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-28 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305530#comment-16305530
 ] 

ASF subversion and git services commented on NIFI-4504:
---

Commit c59a967623da5c1dede58e4b8ff21ddadab913fe in nifi's branch 
refs/heads/master from [~boardm26]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=c59a967 ]

NIFI-4504, NIFI-4505 added removeAndGet, removeByPatternAndGet, and keySet 
methods to MapCache API
  cleaned up some warnings on deprecated nifi.stream.io classes

This closes #2284.

Signed-off-by: Koji Kawamura 


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305532#comment-16305532
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/2284


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305528#comment-16305528
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user ijokarumawak commented on the issue:

https://github.com/apache/nifi/pull/2284
  
@mosermw @devriesb Thanks for sharing your opinions. I think we have enough 
discussion and since there are multiple audience willing to have these method. 
I am going to merge this. Thanks again for your contribution and improving the 
project!


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-28 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305451#comment-16305451
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user devriesb commented on the issue:

https://github.com/apache/nifi/pull/2284
  
Koji,

"Are all of these three methods, removeAndGet, removeByPatternAndGet and
keySet required by the folks you know of?" - Yes.

"atomicity is not that important in these method IMHO" - I think you'll
find not everyone shares that opinion.

Ultimately, removeAndGet behaves the same as the remove() method of the
java Map interface, which is the behavior I (and I would suspect many
others) would expect.  While I understand providing a "flavor" of this
method that does not return the removed value to save network traffic, I
would have preferred those be named differently.  However, since we're now
locked into "remove" not returning the removed value, "removeAndGet" is
likely as good as we're going to get.

Brandon



On Wed, Dec 27, 2017 at 7:59 PM Koji Kawamura 
wrote:

> @mosermw  Thank you for updating the PR, it's
> much easier to review now. The code implemented at
> DistributedMapCacheClientService and MapCacheServer looks good to me.
> Travis error should be fine as the failure looks depending on execution
> condition.
>
> However, let me ask one more time since adding methods is easy but hard to
> remove afterwards for things like this. Are all of these three methods,
> removeAndGet, removeByPatternAndGet and keySet required by the folks you
> know of? I prefer to minimize the addition as those methods are only
> supported by DistributedMapCacheClientService, which means those will not
> be used by most developers who write Processors. Also, it confuses such
> developers which to choose from remove and removeAndGet. Probably I
> imagine these concerns are what made you struggle with implementing 
default
> method to just throw UnsupportedOperationException.
>
> If there is no significant needs for removeAndGet and
> removeByPatternAndGet, then I'd prefer omit these method from
> DistributedMapCacheClient interface. As long as we support keySet, pretty
> much everything can be done at the caller side. The only benefit to have
> AndGet methods I am aware of is reducing the network traffic, and 
atomicity
> (atomicity is not that important in these method IMHO). Do you think those
> are more important than adding mostly unsupported methods into a common
> interface?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> , or mute
> the thread
> 

> .
>



> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304965#comment-16304965
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user ijokarumawak commented on the issue:

https://github.com/apache/nifi/pull/2284
  
@mosermw Thank you for updating the PR, it's much easier to review now. The 
code implemented at DistributedMapCacheClientService and MapCacheServer looks 
good to me. Travis error should be fine as the failure looks depending on 
execution condition.

However, let me ask one more time since adding methods is easy but hard to 
remove afterwards for things like this. Are all of these three methods, 
`removeAndGet`, `removeByPatternAndGet` and `keySet` required by the folks you 
know of? I prefer to minimize the addition as those methods are only supported 
by DistributedMapCacheClientService, which means those will not be used by most 
developers who write Processors. Also, it confuses such developers which to 
choose from `remove` and `removeAndGet`. Probably I imagine these concerns are 
what made you struggle with implementing default method to just throw 
UnsupportedOperationException.

If there is no significant needs for `removeAndGet` and 
`removeByPatternAndGet`, then I'd prefer omit these method from 
DistributedMapCacheClient interface. As long as we support `keySet`, pretty 
much everything can be done at the caller side. The only benefit to have AndGet 
methods I am aware of is reducing the network traffic, and atomicity (atomicity 
is not that important in these method IMHO). Do you think those are more 
important than adding mostly unsupported methods into a common interface?


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304841#comment-16304841
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user mosermw commented on the issue:

https://github.com/apache/nifi/pull/2284
  
I rebased and force pushed the discussed changes.  It appears that the 
Travis failure is unrelated?


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304592#comment-16304592
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user mosermw commented on the issue:

https://github.com/apache/nifi/pull/2284
  
Thank you Joe and Koji for taking a look at this.  I struggled with 
deciding whether to provide a default UnsupportedOperationException or to 
provide the new methods in the various DistributedMapCacheClient 
implementations.  I will happily change this PR to go with the 
UnsupportedOperationException route.  Give me a little time to make the changes 
and force push, but it should be a much smaller PR and easier to review.

I agree that a keySet method could become problematic in a distributed Map 
environment.  However I believe it's important to provide as much of the Java 
Map interface in the distributed Map as we can, and let the implementer beware 
of the potential problems.  I do know some folks who have extended 
DistributedMapCacheClient with their own implementations, and I would like the 
keySet method to exist to support them.


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304168#comment-16304168
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user ijokarumawak commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2284#discussion_r158756230
  
--- 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  type of key
+ * @param  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
+ */
+ Map removeByPatternAndGet(String regex, Deserializer 
keyDeserializer, Deserializer valueDeserializer) throws IOException;
+
+/**
+ * Returns a set of all keys currently in the cache
+ *
+ * @param  type of key
+ * @param keyDeserializer key deserializer
+ * @return a Set of all keys currently in the cache
+ * @throws IOException ex
+ */
+ Set keySet(Deserializer keyDeserializer) throws IOException;
--- End diff --

This method doesn't look realistic. What if the cache storage contains tens 
of thousand or more keys? We should avoid loading all keys into heap.


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304166#comment-16304166
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user ijokarumawak commented on a diff in the pull request:

https://github.com/apache/nifi/pull/2284#discussion_r158755719
  
--- Diff: 
nifi-nar-bundles/nifi-redis-bundle/nifi-redis-extensions/src/main/java/org/apache/nifi/redis/service/RedisDistributedMapCacheClientService.java
 ---
@@ -187,6 +191,16 @@ public void close() throws IOException {
 });
 }
 
+@Override
+public  V removeAndGet(K key, Serializer keySerializer, 
Deserializer valueDeserializer) throws IOException {
+return withConnection(redisConnection -> {
+final byte[] k = serialize(key, keySerializer);
+final byte[] v = redisConnection.get(k);
+redisConnection.del(k);
+return valueDeserializer.deserialize(v);
--- End diff --

For multiple operations like these `get` and `del`, Redis provides 
[multi](https://redis.io/commands/multi) to make those as an atomic execution. 
Since other methods are implemented similarly, I don't have strong opinion to 
use multi here, but we can submit another JIRA for future improvement. How do 
you think?

http://www.rediscookbook.org/get_and_delete.html

https://stackoverflow.com/questions/11148383/how-to-implement-redis-multi-exec-by-using-spring-data-redis


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304165#comment-16304165
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

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 @@
  */
  boolean remove(K key, Serializer 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  type of key
+ * @param  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
+ */
+ V removeAndGet(K key, Serializer keySerializer, 
Deserializer valueDeserializer) throws IOException;
--- End diff --

This new method should have a default implementation which throws 
UnsupportedOperationException.


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304167#comment-16304167
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

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  type of key
+ * @param  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
+ */
+ Map removeByPatternAndGet(String regex, Deserializer 
keyDeserializer, Deserializer valueDeserializer) throws IOException;
--- End diff --

This new method should have a default implementation which throws 
UnsupportedOperationException.


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-12-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16304045#comment-16304045
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

Github user joewitt commented on the issue:

https://github.com/apache/nifi/pull/2284
  
@mosermw can you rebase and force push so we can get travis to do its thing.

We need someone to review.  It *might* be best to make it smaller by 
leaving these new methods unsupported/unused in the existing processors if I'm 
understanding that right.


> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (NIFI-4504) SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet

2017-11-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16261525#comment-16261525
 ] 

ASF GitHub Bot commented on NIFI-4504:
--

GitHub user mosermw opened a pull request:

https://github.com/apache/nifi/pull/2284

NIFI-4504, NIFI-4505 added methods to MapCache API …

… including keySet, removeAndGet, removeByPatternAndGet
  cleaned up some warnings on deprecated nifi.stream.io classes

I attempted to update the various implementations of 
DistributedMapCacheClient,
but if the reviewer feels I should leave them unsupported then let me know.

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [x] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [x] Does your PR title start with NIFI- where  is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.

- [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

- [x] Is your initial contribution a single, squashed commit?

### For code changes:
- [x] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [x] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/mosermw/nifi NIFI-4505

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/2284.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2284


commit 269fb770d793962a4dbb85b00f66b2d247ebd0fe
Author: Mike Moser 
Date:   2017-11-15T21:54:46Z

NIFI-4504, NIFI-4505 added removeAndGet, removeByPatternAndGet, and keySet 
methods to MapCache API
  cleaned up some warnings on deprecated nifi.stream.io classes




> SimpleMapCache/PersistentMapCache: Add removeAndGet and removeByPatternAndGet
> -
>
> Key: NIFI-4504
> URL: https://issues.apache.org/jira/browse/NIFI-4504
> Project: Apache NiFi
>  Issue Type: Improvement
>Affects Versions: 1.4.0
>Reporter: Jon Kessler
>Assignee: Michael Moser
>Priority: Minor
>
> Typical map implementations return the value that was removed when performing 
> a remove. Because you couldn't update the existing remove methods without it 
> being a breaking change I suggest adding new versions of the remove and 
> removeByPattern methods that return the removed value(s).
> These changes should also be applied up the chain to any class that makes use 
> of these classes such as the MapCacheServer and 
> AtomicDistributedMapCacheClient.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)