-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: Add the XREADGROUP
command
#376
Java: Add the XREADGROUP
command
#376
Conversation
XREADGROUP
command
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/commands/stream/StreamReadOptions.java
Show resolved
Hide resolved
@@ -128,7 +129,10 @@ public static <T> Map<String, T[][]> castMapOf2DArray( | |||
return null; | |||
} | |||
return mapOfArrays.entrySet().stream() | |||
.collect(Collectors.toMap(Map.Entry::getKey, e -> castArrayofArrays(e.getValue(), clazz))); | |||
.collect( | |||
HashMap::new, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change? to accept nulls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. XREADGROUP returns maps will null values (gross!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a test for that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do
@@ -753,6 +771,18 @@ private static Object[] streamCommands(BaseTransaction<?> transaction) { | |||
1L, // xtrim(streamKey1, new MinId(true, "0-2")) | |||
OK, // xgroupCreate(streamKey1, groupName1, "0-0") | |||
OK, // xgroupCreate(streamKey1, groupName1, "0-0", options) | |||
true, // xgroupCreateConsumer(streamKey1, groupName1, consumer1) | |||
Map.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can store this as a variable if it ease reading/debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be a good idea... ;)
java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/StreamBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/StreamBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/StreamBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/StreamBaseCommands.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/models/BaseTransaction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
Signed-off-by: Andrew Carbonetto <[email protected]>
b3efde5
to
957e012
Compare
@@ -791,6 +791,7 @@ fn convert_to_array_of_pairs( | |||
value_expected_return_type: Option<ExpectedReturnType>, | |||
) -> RedisResult<Value> { | |||
match response { | |||
Value::Nil => Ok(response), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XREADGROUP can/will return null values in the map
Signed-off-by: Andrew Carbonetto <[email protected]>
14e3c24
into
java/integ_acarbo_add_xreadgroup
* Java: Add the `XREADGROUP` command (#376) * Add XGROUP CreateConsumer, DelConsumer Signed-off-by: Andrew Carbonetto <[email protected]> * Add XREADGROUP command Signed-off-by: Andrew Carbonetto <[email protected]> * Udpate IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * Fix IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * SPOTLESS & merge conflict fix Signed-off-by: Andrew Carbonetto <[email protected]> * Update for review comments Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]> * Remove old test from IT suite Signed-off-by: Andrew Carbonetto <[email protected]> * Update xreadgroup docs Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]>
* Add XGROUP CreateConsumer, DelConsumer Signed-off-by: Andrew Carbonetto <[email protected]> * Add XREADGROUP command Signed-off-by: Andrew Carbonetto <[email protected]> * Udpate IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * Fix IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * SPOTLESS & merge conflict fix Signed-off-by: Andrew Carbonetto <[email protected]> * Update for review comments Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]>
* Java: Add the `XREADGROUP` command (#376) * Add XGROUP CreateConsumer, DelConsumer Signed-off-by: Andrew Carbonetto <[email protected]> * Add XREADGROUP command Signed-off-by: Andrew Carbonetto <[email protected]> * Udpate IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * Fix IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * SPOTLESS & merge conflict fix Signed-off-by: Andrew Carbonetto <[email protected]> * Update for review comments Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]> * Added implementation and incomplete transactiontests * Update test Signed-off-by: Andrew Carbonetto <[email protected]> * Add XACK test Signed-off-by: Andrew Carbonetto <[email protected]> * Remove extra test Signed-off-by: Andrew Carbonetto <[email protected]> * More merge conflict cleanup Signed-off-by: Andrew Carbonetto <[email protected]> * Process review comments Signed-off-by: Andrew Carbonetto <[email protected]> * XACK add failure tests Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]> Co-authored-by: Guian Gumpac <[email protected]>
* Java: Add the `XREADGROUP` command (#376) * Add XGROUP CreateConsumer, DelConsumer Signed-off-by: Andrew Carbonetto <[email protected]> * Add XREADGROUP command Signed-off-by: Andrew Carbonetto <[email protected]> * Udpate IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * Fix IT tests Signed-off-by: Andrew Carbonetto <[email protected]> * SPOTLESS & merge conflict fix Signed-off-by: Andrew Carbonetto <[email protected]> * Update for review comments Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]> * Remove old test from IT suite Signed-off-by: Andrew Carbonetto <[email protected]> * Update xreadgroup docs Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]>
Dependent on valkey-io#1599
Adds the XREADGROUP command to Java
TODO: