Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jduo committed Jun 30, 2024
1 parent ee8b4a1 commit 843c511
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ CompletableFuture<String> xgroupCreate(
CompletableFuture<Long> xgroupDelConsumer(String key, String group, String consumer);

/**
* Set the last delivered ID for a consumer group.
* Sets the last delivered ID for a consumer group.
*
* @see <a href="https://valkey.io/commands/xgroup-setid/">valkey.io</a> for details.
* @param key The key of the stream.
Expand All @@ -461,17 +461,17 @@ CompletableFuture<String> xgroupCreate(
CompletableFuture<String> xgroupSetId(String key, String groupName, String id);

/**
* Set the last delivered ID for a consumer group.
* Sets the last delivered ID for a consumer group.
*
* @since Redis 7.0 and above
* @see <a href="https://valkey.io/commands/xgroup-setid/">valkey.io</a> for details.
* @param key The key of the stream.
* @param groupName The newly created consumer group name.
* @param id The stream entry ID that should be set as the last delivered ID for the consumer
* group.
* @param entriesReadId An arbitrary ID (that isn't the first ID, last ID, or the zero ID (<code>
* "0-0"</code>)) used to find out how many entries are between the arbitrary ID (excluding
* it) and the stream's last entry. This argument can only be specified if you are using Redis
* version 7.0.0 or above.
* it) and the stream's last entry.
* @return <code>OK</code>.
* @example
* <pre>{@code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3108,7 +3108,7 @@ public T xgroupDelConsumer(@NonNull String key, @NonNull String group, @NonNull
}

/**
* Set the last delivered ID for a consumer group.
* Sets the last delivered ID for a consumer group.
*
* @see <a href="https://valkey.io/commands/xgroup-setid/">valkey.io</a> for details.
* @param key The key of the stream.
Expand All @@ -3123,17 +3123,17 @@ public T xgroupSetId(@NonNull String key, @NonNull String groupName, @NonNull St
}

/**
* Set the last delivered ID for a consumer group.
* Sets the last delivered ID for a consumer group.
*
* @since Redis 7.0 and above
* @see <a href="https://valkey.io/commands/xgroup-setid/">valkey.io</a> for details.
* @param key The key of the stream.
* @param groupName The newly created consumer group name.
* @param id The stream entry ID that should be set as the last delivered ID for the consumer
* group.
* @param entriesReadId An arbitrary ID (that isn't the first ID, last ID, or the zero ID (<code>
* "0-0"</code>)) used to find out how many entries are between the arbitrary ID (excluding
* it) and the stream's last entry. This argument can only be specified if you are using Redis
* version 7.0.0 or above.
* it) and the stream's last entry.
* @return Command Response - <code>OK</code>.
*/
public T xgroupSetId(
Expand Down
8 changes: 3 additions & 5 deletions java/integTest/src/test/java/glide/SharedCommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -4161,8 +4161,7 @@ public void xgroupSetId_entriesRead(BaseClient client) {
String streamId1_2 = "1-2";

// Setup: Create stream with 3 entries, create consumer group, read entries to add them to the
// Pending Entries
// List.
// Pending Entries List.
assertEquals(
streamId1_0,
client
Expand Down Expand Up @@ -4196,15 +4195,14 @@ public void xgroupSetId_entriesRead(BaseClient client) {
assertNull(client.xreadgroup(Map.of(key, ">"), groupName, consumerName).get());

// Reset the last delivered ID for the consumer group to "1-1".
// ENRIESREAD is only supported in Redis version 7.0.0
// ENTRIESREAD is only supported in Redis version 7.0.0 and higher.
if (REDIS_VERSION.isLowerThan("7.0.0")) {
assertEquals(OK, client.xgroupSetId(key, groupName, streamId1_1).get());
} else {
assertEquals(OK, client.xgroupSetId(key, groupName, streamId1_1, streamId0).get());

// The entriesReadId cannot be the first, last, or zero ID. Here we pass the first ID and
// assert
// that an error is raised.
// assert that an error is raised.
ExecutionException executionException =
assertThrows(
ExecutionException.class,
Expand Down

0 comments on commit 843c511

Please sign in to comment.