-
Notifications
You must be signed in to change notification settings - Fork 53
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
Valkey-8: add BY/GET support for SORT/RO in cluster mode #2252
Conversation
8ad4757
to
8b95058
Compare
daeef61
to
c03ac99
Compare
* @apiNote When in cluster mode, both <code>key</code> and the patterns specified in {@link | ||
* SortOptions#byPattern} and {@link SortOptions#getPatterns} must hash to the same slot. The | ||
* use of {@link SortOptions#byPattern} and {@link SortOptions#getPatterns} in cluster mode is | ||
* supported since Valkey version 8.0. |
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.
Nice!
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.
Please add sross slot test there
node/src/Commands.ts
Outdated
*/ | ||
export type SortOptions = SortBaseOptions & { | ||
export type SortOptions = { |
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.
According to new starndards introduced by Avi, this should an interface
node/src/GlideClient.ts
Outdated
@@ -9,8 +9,7 @@ import { | |||
Decoder, | |||
DecoderOption, | |||
GlideString, | |||
PubSubMsg, | |||
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars | |||
PubSubMsg, // eslint-disable-line @typescript-eslint/no-unused-vars |
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.
Please revert
node/src/GlideClusterClient.ts
Outdated
@@ -9,8 +9,7 @@ import { | |||
Decoder, | |||
DecoderOption, | |||
GlideString, | |||
PubSubMsg, | |||
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars | |||
PubSubMsg, // eslint-disable-line @typescript-eslint/no-unused-vars |
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.
same
node/src/Transaction.ts
Outdated
@@ -6,8 +6,7 @@ import { | |||
BaseClient, // eslint-disable-line @typescript-eslint/no-unused-vars | |||
GlideRecord, | |||
GlideString, | |||
HashDataType, | |||
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars | |||
HashDataType, // eslint-disable-line @typescript-eslint/no-unused-vars |
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.
Same
node/tests/SharedTests.ts
Outdated
@@ -3006,7 +3006,9 @@ export function runBaseTests(config: { | |||
expect( | |||
await client.sinter( | |||
[Buffer.from(key1), Buffer.from(key2)], | |||
{ decoder: Decoder.Bytes }, | |||
{ |
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? linter? why?
c03ac99
to
9b7ba33
Compare
@@ -1251,6 +1308,7 @@ CompletableFuture<String> restore( | |||
* This command is routed depending on the client's {@link ReadFrom} strategy. | |||
* | |||
* @since Valkey 7.0 and above. | |||
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details. |
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.
404 not found
@@ -1269,6 +1327,7 @@ CompletableFuture<String> restore( | |||
* This command is routed depending on the client's {@link ReadFrom} strategy. | |||
* | |||
* @since Valkey 7.0 and above. | |||
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details. |
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.
404 not found
* use of {@link SortOptions#byPattern} and {@link SortOptions#getPatterns} in cluster mode is | ||
* supported since Valkey version 8.0. | ||
* @since Valkey 7.0 and above. | ||
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details. |
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.
404 not found
I'm not sure we should be added a reference here that doesn't exist. It kind of looks bad. Maybe just add a link to sort?
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 dont know why this page doesnt exist
* same slot. The use of {@link SortOptionsBinary#byPattern} and {@link | ||
* SortOptionsBinary#getPatterns} in cluster mode is supported since Valkey version 8.0. | ||
* @since Valkey 7.0 and above. | ||
* @see <a href="https://valkey.io/commands/sort_ro/">valkey.io</a> for details. |
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.
same
@MethodSource("getClients") | ||
public void sort_with_pattern(BaseClient client) { | ||
if (client instanceof GlideClusterClient) { | ||
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.9.0"), "This feature added in version 8"); |
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 know Valkey 7.9 is 8 (while in RC). I am just wondering whether we need to update the test to use "8.0.0" or just leave "7.9.0" as is.
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 have an issue to change that once valkey 8 is released
e75d3d0
to
e4f14f2
Compare
Signed-off-by: Shoham Elias <[email protected]>
e4f14f2
to
4569e52
Compare
No description provided.