Skip to content

Valkey-8: add BY/GET support for SORT/RO in cluster mode#2252

Merged
shohamazon merged 1 commit intovalkey-io:mainfrom
shohamazon:sort-valkey-8
Sep 12, 2024
Merged

Valkey-8: add BY/GET support for SORT/RO in cluster mode#2252
shohamazon merged 1 commit intovalkey-io:mainfrom
shohamazon:sort-valkey-8

Conversation

@shohamazon
Copy link
Copy Markdown
Collaborator

No description provided.

@shohamazon shohamazon force-pushed the sort-valkey-8 branch 2 times, most recently from 8ad4757 to 8b95058 Compare September 9, 2024 13:44
@shohamazon shohamazon added python 🐍 Python wrapper node 🐢 Node.js wrapper java ☕ issues and fixes related to the java client Valkey-8 labels Sep 9, 2024
@shohamazon shohamazon force-pushed the sort-valkey-8 branch 2 times, most recently from daeef61 to c03ac99 Compare September 10, 2024 14:43
@shohamazon shohamazon added the Release blocker 🛡️ Can't release without. label Sep 10, 2024
@shohamazon shohamazon marked this pull request as ready for review September 10, 2024 15:01
@shohamazon shohamazon requested a review from a team as a code owner September 10, 2024 15:01
Comment on lines +1256 to +1259
* @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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Copy Markdown

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

* slot as the key, and this is supported only since Valkey version 8.0.
*/
export type SortOptions = SortBaseOptions & {
export type SortOptions = {
Copy link
Copy Markdown

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

GlideString,
PubSubMsg,
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars
PubSubMsg, // eslint-disable-line @typescript-eslint/no-unused-vars
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert

GlideString,
PubSubMsg,
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars
PubSubMsg, // eslint-disable-line @typescript-eslint/no-unused-vars
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

GlideString,
HashDataType,
ReadFrom, // eslint-disable-line @typescript-eslint/no-unused-vars
HashDataType, // eslint-disable-line @typescript-eslint/no-unused-vars
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

await client.sinter(
[Buffer.from(key1), Buffer.from(key2)],
{ decoder: Decoder.Bytes },
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? linter? why?

@shohamazon shohamazon mentioned this pull request Sep 11, 2024
7 tasks
* 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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

404 not found

* 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.
Copy link
Copy Markdown
Contributor

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.
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Collaborator Author

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.
Copy link
Copy Markdown
Contributor

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");
Copy link
Copy Markdown
Collaborator

@yipin-chen yipin-chen Sep 11, 2024

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.

Copy link
Copy Markdown
Collaborator Author

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

@shohamazon shohamazon force-pushed the sort-valkey-8 branch 2 times, most recently from e75d3d0 to e4f14f2 Compare September 12, 2024 11:23
Signed-off-by: Shoham Elias <shohame@amazon.com>
@shohamazon shohamazon merged commit 783a9f0 into valkey-io:main Sep 12, 2024
@shohamazon shohamazon deleted the sort-valkey-8 branch September 12, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java ☕ issues and fixes related to the java client node 🐢 Node.js wrapper python 🐍 Python wrapper Release blocker 🛡️ Can't release without.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants