[ 
https://issues.apache.org/jira/browse/IGNITE-4244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15676410#comment-15676410
 ] 

Roman Shtykh edited comment on IGNITE-4244 at 11/18/16 10:57 AM:
-----------------------------------------------------------------

[~anovikov] Andrey, I was looking at INCR/DECR implementation, and looks like I 
got it wrong.

I thought that I can put a value and then increment/decrement it, but it 
appears that this operations are done on {{IgniteAtomicLong}} and cannot be 
accessed by put or get operation (memcached and rest implemetations also have 
this limitation).
The value of atomic long can be known only on return of increment/decrement 
operation.

i.e., you can do
{code}
client.put("key")

client.increment("key")

client.get("key")
{code}

but key's value you access with {{get}} won't be incremented, because it is not 
the atomic long you do increment.
This is my understanding.

Therefore, I changed the implementation of these Redis commands. It is not 
exactly what a user expects but this is how rest is implemented.

Can you please have a look?



was (Author: roman_s):
[~anovikov] Andrey, I was looking at INCR/DECR implementation, and looks like I 
got it wrong.

I thought that I can put a value and then increment/decrement it, but it 
appears that this operations are done on {{IgniteAtomicLong}} and cannot be 
accessed by put or get operation (memcached and rest implemetations also have 
this limitation).
The value of atomic long can be known only on return of increment/decrement 
operation.

i.e., you can do
{code}
client.put("key")

client.increment("key")

client.get("key")
{code}

but key's value you access with {{get}} won't be incremented, because it is not 
the atomic long you do increment.
This is my understanding.

Therefore, I changed the implementation of Redis commands. It is not exactly 
what a user expects but this is how rest is implemented.

Can you please have a look?


> Redis INCR/DECR to operate on AtomicLong.
> -----------------------------------------
>
>                 Key: IGNITE-4244
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4244
>             Project: Ignite
>          Issue Type: Sub-task
>            Reporter: Roman Shtykh
>            Assignee: Roman Shtykh
>
> "The INCR command parses the string value as an integer, increments it by 
> one, and finally sets the obtained value as the new value. " 
> http://redis.io/topics/data-types-intro



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to