Skip to content

Commit

Permalink
addressing comments part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesx-improving committed Jul 5, 2024
1 parent a1bc3f9 commit 4a53b16
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 88 deletions.
104 changes: 34 additions & 70 deletions java/client/src/main/java/glide/api/commands/StreamBaseCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Supports commands and transactions for the "Stream Commands" group for standalone and cluster
* clients.
*
* @see <a href="https://redis.io/commands/?group=stream">Stream Commands</a>
* @see <a href="https://valkey.io/commands/?group=stream">Stream Commands</a>
*/
public interface StreamBaseCommands {

Expand Down Expand Up @@ -676,7 +676,7 @@ CompletableFuture<String> xgroupCreate(
/**
* Sets the last delivered ID for a consumer group.
*
* @since Redis 7.0 and above
* @since Valkey 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 consumer group name.
Expand Down Expand Up @@ -1168,7 +1168,7 @@ CompletableFuture<Map<GlideString, GlideString[][]>> xclaim(

/**
* Changes the ownership of a pending message. This function returns an <code>array</code> with
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Redis API.
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Valkey API.
*
* @see <a href="https://valkey.io/commands/xclaim/">valkey.io</a> for details.
* @param key The key of the stream.
Expand All @@ -1193,7 +1193,7 @@ CompletableFuture<String[]> xclaimJustId(

/**
* Changes the ownership of a pending message. This function returns an <code>array</code> with
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Redis API.
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Valkey API.
*
* @see <a href="https://valkey.io/commands/xclaim/">valkey.io</a> for details.
* @param key The key of the stream.
Expand Down Expand Up @@ -1222,7 +1222,7 @@ CompletableFuture<GlideString[]> xclaimJustId(

/**
* Changes the ownership of a pending message. This function returns an <code>array</code> with
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Redis API.
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Valkey API.
*
* @see <a href="https://valkey.io/commands/xclaim/">valkey.io</a> for details.
* @param key The key of the stream.
Expand Down Expand Up @@ -1251,7 +1251,7 @@ CompletableFuture<String[]> xclaimJustId(

/**
* Changes the ownership of a pending message. This function returns an <code>array</code> with
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Redis API.
* only the message/entry IDs, and is equivalent to using <code>JUSTID</code> in the Valkey API.
*
* @see <a href="https://valkey.io/commands/xclaim/">valkey.io</a> for details.
* @param key The key of the stream.
Expand Down Expand Up @@ -1383,15 +1383,15 @@ CompletableFuture<Map<GlideString, Object>[]> xinfoConsumers(
* @param minIdleTime The minimum idle time for the message to be claimed.
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A mapping of the claimed entries, with the keys being the claimed entry IDs and the
* values being a 2D list of the field-value pairs in the format <code>
* [[field1, value1], [field2, value2], ...]</code>.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1401,10 +1401,7 @@ CompletableFuture<Map<GlideString, Object>[]> xinfoConsumers(
* Object[] result = client.xautoclaim("my_stream", "my_group", "my_consumer", 3_600_000L, "0-0").get();
* assertEquals(streamid_1, result[0]);
* assertDeepEquals(Map.of(streamid_0, new String[][] {{"f1", "v1"}}),result[1]);
* if(REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")){
* assertDeepEquals(new Object[] {},result[2]);
* }
*
* assertDeepEquals(new Object[] {},result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaim(
Expand All @@ -1420,15 +1417,15 @@ CompletableFuture<Object[]> xautoclaim(
* @param minIdleTime The minimum idle time for the message to be claimed.
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A mapping of the claimed entries, with the keys being the claimed entry IDs and the
* values being a 2D list of the field-value pairs in the format <code>
* [[field1, value1], [field2, value2], ...]</code>.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1438,10 +1435,7 @@ CompletableFuture<Object[]> xautoclaim(
* Object[] result = client.xautoclaim(gs("my_stream"), gs("my_group"), gs("my_consumer"), 3_600_000L, gs("0-0")).get();
* assertEquals(streamid_1, result[0]);
* assertDeepEquals(Map.of(streamid_0, new GlideString[][] {{gs("f1"), gs("v1")}}),result[1]);
* if(REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")){
* assertDeepEquals(new Object[] {},result[2]);
* }
*
* assertDeepEquals(new Object[] {},result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaim(
Expand All @@ -1462,15 +1456,15 @@ CompletableFuture<Object[]> xautoclaim(
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @param count Limits the number of claimed entries to the specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A mapping of the claimed entries, with the keys being the claimed entry IDs and the
* values being a 2D list of the field-value pairs in the format <code>
* [[field1, value1], [field2, value2], ...]</code>.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1480,10 +1474,7 @@ CompletableFuture<Object[]> xautoclaim(
* Object[] result = client.xautoclaim("my_stream", "my_group", "my_consumer", 3_600_000L, "0-0", 1L).get();
* assertEquals(streamid_1, result[0]);
* assertDeepEquals(Map.of(streamid_0, new String[][] {{"f1", "v1"}}),result[1]);
* if(REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")){
* assertDeepEquals(new Object[] {},result[2]);
* }
*
* assertDeepEquals(new Object[] {},result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaim(
Expand All @@ -1500,15 +1491,15 @@ CompletableFuture<Object[]> xautoclaim(
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @param count Limits the number of claimed entries to the specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A mapping of the claimed entries, with the keys being the claimed entry IDs and the
* values being a 2D list of the field-value pairs in the format <code>
* [[field1, value1], [field2, value2], ...]</code>.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1518,10 +1509,7 @@ CompletableFuture<Object[]> xautoclaim(
* Object[] result = client.xautoclaim(gs("my_stream"), gs("my_group"), gs("my_consumer"), 3_600_000L, gs("0-0"), 1L).get();
* assertEquals(streamid_1, result[0]);
* assertDeepEquals(Map.of(streamid_0, new GlideString[][] {{gs("f1"), gs("v1")}}),result[1]);
* if(REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")){
* assertDeepEquals(new Object[] {},result[2]);
* }
*
* assertDeepEquals(new Object[] {},result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaim(
Expand All @@ -1544,13 +1532,13 @@ CompletableFuture<Object[]> xautoclaim(
* @param minIdleTime The minimum idle time for the message to be claimed.
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A list of the IDs for the claimed entries.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1559,14 +1547,8 @@ CompletableFuture<Object[]> xautoclaim(
* <pre>{@code
* Object[] result = client.xautoclaimJustId("my_stream", "my_group", "my_consumer", 3_600_000L, "0-0").get();
* assertEquals(zeroStreamId, result[0]);
* if (REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")) {
* assertDeepEquals(new String[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]);
* }
* else {
* assertDeepEquals(new String[] {streamid_0, streamid_1, streamid_2, streamid_3}, result[1]);
* }
*
* assertDeepEquals(new String[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaimJustId(
Expand All @@ -1584,13 +1566,13 @@ CompletableFuture<Object[]> xautoclaimJustId(
* @param minIdleTime The minimum idle time for the message to be claimed.
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A list of the IDs for the claimed entries.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1599,14 +1581,8 @@ CompletableFuture<Object[]> xautoclaimJustId(
* <pre>{@code
* Object[] result = client.xautoclaimJustId(gs("my_stream"), gs("my_group"), gs("my_consumer"), 3_600_000L, gs("0-0")).get();
* assertEquals(zeroStreamId, result[0]);
* if (REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")) {
* assertDeepEquals(new GlideString[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]);
* }
* else {
* assertDeepEquals(new GlideString[] {streamid_0, streamid_1, streamid_2, streamid_3}, result[1]);
* }
*
* assertDeepEquals(new GlideString[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaimJustId(
Expand All @@ -1629,13 +1605,13 @@ CompletableFuture<Object[]> xautoclaimJustId(
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @param count Limits the number of claimed entries to the specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A list of the IDs for the claimed entries.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1644,14 +1620,8 @@ CompletableFuture<Object[]> xautoclaimJustId(
* <pre>{@code
* Object[] result = client.xautoclaimJustId("my_stream", "my_group", "my_consumer", 3_600_000L, "0-0", 1L).get();
* assertEquals(zeroStreamId, result[0]);
* if (REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")) {
* assertDeepEquals(new String[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]);
* }
* else {
* assertDeepEquals(new String[] {streamid_0, streamid_1, streamid_2, streamid_3}, result[1]);
* }
*
* assertDeepEquals(new String[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaimJustId(
Expand All @@ -1670,13 +1640,13 @@ CompletableFuture<Object[]> xautoclaimJustId(
* @param start Filters the claimed entries to those that have an ID equal or greater than the
* specified value.
* @param count Limits the number of claimed entries to the specified value.
* @return An array containing the following elements:
* @return An <code>array</code> containing the following elements:
* <ul>
* <li>A stream ID to be used as the start argument for the next call to <code>XAUTOCLAIM
* </code>. This ID is equivalent to the next ID in the stream after the entries that
* were scanned, or "0-0" if the entire stream was scanned.
* <li>A list of the IDs for the claimed entries.
* <li>If you are using Redis 7.0.0 or above, the response list will also include a list
* <li>If you are using Valkey 7.0.0 or above, the response list will also include a list
* containing the message IDs that were in the Pending Entries List but no longer exist
* in the stream. These IDs are deleted from the Pending Entries List.
* </ul>
Expand All @@ -1685,14 +1655,8 @@ CompletableFuture<Object[]> xautoclaimJustId(
* <pre>{@code
* Object[] result = client.xautoclaimJustId(gs("my_stream"), gs("my_group"), gs("my_consumer"), 3_600_000L, gs("0-0"), 1L).get();
* assertEquals(zeroStreamId, result[0]);
* if (REDIS_VERSION.isGreaterThanOrEqualTo("7.0.0")) {
* assertDeepEquals(new GlideString[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]);
* }
* else {
* assertDeepEquals(new GlideString[] {streamid_0, streamid_1, streamid_2, streamid_3}, result[1]);
* }
*
* assertDeepEquals(new GlideString[] {streamid_0, streamid_1, streamid_3}, result[1]);
* assertDeepEquals(new Object[] {}, result[2]); // version 7.0.0 or above
* }</pre>
*/
CompletableFuture<Object[]> xautoclaimJustId(
Expand Down
Loading

0 comments on commit 4a53b16

Please sign in to comment.