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

Andrey Novikov commented on IGNITE-3066:
----------------------------------------

1) This commands: "set, setrange, mget" internaly implemented by REST commands. 
I think it will be better to directly call Ignite Cache API? 
Also this will solve problem with ttl on set, return (nil) on mget (there a 
TODO in code).

2) You implement different handlers for each command. May be it is possible to 
combine these handlers in one like GridCacheCommandHandler, 
QueryCommandHandler, ... ?

3) STRLEN command http://redis.io/commands/strlen
By description: "An error is returned when key holds a non-string value", but 
in GridRedisStrlenCommandHandler we always return length. Is this correct?

4) If argument parsing failed we throw IgniteChecked Exception in handlers for 
examples: GridJettyRestHandler#longValue, GridTaskCommandHandler.java:211
May be same should be implemented in GridRedisSetCommandHandler.java:75, 
GridRedisSetRangeCommandHandler.java:72, GridRedisGetSetCommandHandler.java:65, 
...

5) Wrong message format: GridRedisMessage#toString. For message with one 
parameter need use following format: "some text: " + msgParts
For debug purpose toString should be implemented like 
S.toString(GridRedisMessage.class, this);

6) We don't use "!" in the end of error message (several places). Message with 
error should look: "Some error: " + errVal,
but not like: "Some error! " + errVal,

7) "public" modifier must be present in interface methods/fields:
org.apache.ignite.internal.processors.rest.handlers.redis.GridRedisCommandHandler

8) Comment is absent:
GridRedisMessage#append, GridRedisMessage#toString

9) Wrong TODO format 
https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-TODOs
GridRedisSetCommandHandler.java:91

10) Not need brace for one-liner statement. 
https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-BracesandIdentation
GridRedisIncrDecrCommandHandler.java:84, GridRedisProtocolParser.java:307

> Set of Redis commands that can be easily implemented via existing REST 
> commands
> -------------------------------------------------------------------------------
>
>                 Key: IGNITE-3066
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3066
>             Project: Ignite
>          Issue Type: Sub-task
>            Reporter: Roman Shtykh
>            Assignee: Roman Shtykh
>
> As the 1st iteration of IGNITE-2788 the following commands can be implemented 
> via existing REST commands,
> GET
> MGET
> SET
> MSET
> INCR
> DECR
> INCRBY
> DECRBY
> APPEND
> STRLEN
> GETSET
> SETRANGE
> GETRANGE
> DEL
> EXISTS
> DBSIZE
> http://redis.io/commands



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

Reply via email to