[
https://issues.apache.org/jira/browse/IGNITE-4244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15689707#comment-15689707
]
Andrey Novikov commented on IGNITE-4244:
----------------------------------------
Hi [~roman_s],
I reviewed your pull request and I think this behavior leads to problems with
set initial value or reset counter. Simple example
http://redis.io/commands/incr#examples from documentation will not work.
To fix this we need use Ignite API in commmands INCR/DECR and GET, SET
I suggest using the following sequence in INCR/DECR:
* Remove from cache by key.
* If removed value not null try to parse and use as initial value on fail use 0.
* Get IgniteAtomicLong with initial value and create flag true.
https://apacheignite.readme.io/docs/atomic-types
* exetute INCR/DECR logic under IgniteAtomicLong.
SET:
* If value with this key not exist in cache try to remove IgniteAtomicLong
* exetute SET logic.
GET:
* If value not exists in cache by key then try to get IgniteAtomicLong by key
and return it's value.
> 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
> Labels: redis
> Fix For: 1.8
>
>
> "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)