ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Shtykh (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IGNITE-4244) Redis INCR/DECR should operate on strings
Date Fri, 18 Nov 2016 10:54:58 GMT

    [ 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:54 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 Redis commands. It is not exactly what a user expects
but this is how rest is implemented.

Can you please have a look? I haven't created a pull request yet, since I am not sure my understanding
is correct.
https://github.com/shroman/ignite/commit/518857097e2de888c5c56e8b1ef543cf3548c041



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? I haven't created a pull request yet, since I am not sure my understanding
is correct.
https://github.com/shroman/ignite/commit/518857097e2de888c5c56e8b1ef543cf3548c041

If it is correct, I will change the title of this JIRA ticket then.

> Redis INCR/DECR should operate on strings
> -----------------------------------------
>
>                 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)

Mime
View raw message