Introducing JSON to Lettuce#2933
Conversation
jruaux
left a comment
There was a problem hiding this comment.
This looks really good! It will be a nice addition to Lettuce.
Just a couple things:
- I did not see tests against Redis Cluster.
- There does not seem to be an implementation of key routing in case of JSON.MGET with the Cluster API.
Hey @jruaux , thanks a lot for taking a look! Yeah these two points are very valid ones. Let me see if I can address them with an update. |
127d29e to
fc5d14b
Compare
|
Hey @tishun, |
No, but this is because the PR is fork/redis-json -> origin/redis-json and origin/redis-json is now behind origin/main I will try to fix this. |
There was a problem hiding this comment.
Overall, this is a good first iteration, but binding all JSON interfaces to generic types of Lettuce codec seems unnecessary and just increases the complexity of the code. Also, we need more developer-friendly overloads for frequently used commands like JSON.SET. See my inline comments for more details.
src/main/java/io/lettuce/core/api/async/RedisJsonAsyncCommands.java
Outdated
Show resolved
Hide resolved
src/main/java/io/lettuce/core/api/async/RedisJsonAsyncCommands.java
Outdated
Show resolved
Hide resolved
9b3892b to
fd842b3
Compare
There is no way to use the Codec system without having the generics, as we discussed offline. I do - however - agree that the
Agreed, this is one of the leftovers |
After some more careful consideration I actually fully agree with you. The latest version does not have any generics for the JsonValue / JsonParser abstractions as they did not help in any way. |
atakavci
left a comment
There was a problem hiding this comment.
great job here i believe.
elegant and easy to read implementation. thanks for the well-organized test stuff as well.
left just a couple of comments and the rest is mostly nits.
src/main/java/io/lettuce/core/api/reactive/RedisReactiveCommands.java
Outdated
Show resolved
Hide resolved
src/test/java/io/lettuce/core/output/NumberListOutputUnitTests.java
Outdated
Show resolved
Hide resolved
src/test/java/io/lettuce/core/json/RedisJsonClusterIntegrationTests.java
Outdated
Show resolved
Hide resolved
Started JSON README.md; Parser registry is now part of the Connection; formatting; chained all commands; extracted commands in their own unit RedisJsonCommandBuilder;
…configuration for custom parsers
…e with existing infra
2b5970c to
ae602b0
Compare
* Most of the API layer * Add the JSON.TYPE command * Kotlin coroutines added; Started JSON README.md; Parser registry is now part of the Connection; formatting; chained all commands; extracted commands in their own unit RedisJsonCommandBuilder; * Implemented 90% of commands from top 10 * All but SET are implemented * Integrated Jackson, finished up the SET command * Left out a few files by mistake * Adding some JavaDoc * Formatting * Implemented all JSON commands * Introducing test containers to the testing fw * Complete coverage with integration tests, straight scenarios * Added Pathv1 tests * Added RedisCE cluster support for the JSON.MGET and JSON.MSET commands * Handle null values * No longer using K for the JSON object keys * Polishing * JsonType introduced to help typization * Remove the RedisCodec from the JsonValue/JsonParser abstraction, add configuration for custom parsers * Extend API surface with methods that reduce the amount of required arguments * Adding unit tests, addressing changes to README.md * Implemented object-mapping functionality * Addresses Ali's comments * Addressed last bunch of comments from Ali, changed ports to not colide with existing infra * Forgot to change ports and stop debug log * Polishing touches
* Most of the API layer * Add the JSON.TYPE command * Kotlin coroutines added; Started JSON README.md; Parser registry is now part of the Connection; formatting; chained all commands; extracted commands in their own unit RedisJsonCommandBuilder; * Implemented 90% of commands from top 10 * All but SET are implemented * Integrated Jackson, finished up the SET command * Left out a few files by mistake * Adding some JavaDoc * Formatting * Implemented all JSON commands * Introducing test containers to the testing fw * Complete coverage with integration tests, straight scenarios * Added Pathv1 tests * Added RedisCE cluster support for the JSON.MGET and JSON.MSET commands * Handle null values * No longer using K for the JSON object keys * Polishing * JsonType introduced to help typization * Remove the RedisCodec from the JsonValue/JsonParser abstraction, add configuration for custom parsers * Extend API surface with methods that reduce the amount of required arguments * Adding unit tests, addressing changes to README.md * Implemented object-mapping functionality * Addresses Ali's comments * Addressed last bunch of comments from Ali, changed ports to not colide with existing infra * Forgot to change ports and stop debug log * Polishing touches
Granted, this review turned out much much much bigger than I anticipated.
Instructions for reviewing
Ideally please concentrate on the most important decisions:
General considerations
(for more details check the README.md with some more information)
This implementation aims to solve several general problems:
Three operating modes facilitating default (basic), advanced and power-user usage
Default mode
Advanced mode
ClientOptions- to configure a customJsonParserPower-user mode
Notes
Unrelated changes
There are a unrelated changes such as
Supported commands
Make sure that:
mvn formatter:formattarget. Don’t submit any formatting related changes.