You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Roman Shtykh (JIRA)" <ji...@apache.org> on 2016/11/18 10:31:59 UTC

[jira] [Commented] (IGNITE-4244) Redis INCR/DECR should operate on strings

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

Roman Shtykh commented on IGNITE-4244:
--------------------------------------

[~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)