Skip to content
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

Add SortedSetCount to IGarnetApi #978

Merged
merged 5 commits into from
Feb 3, 2025
Merged

Conversation

badrishc
Copy link
Contributor

@badrishc badrishc commented Jan 30, 2025

We already have SortedSetCount exposed via network as ZCOUNT but there was no way to access it programmatically from the custom stored procedure.

This PR adds the SortedSetCount API to IGarnetApi, and uses it in a sample test custom transaction (stored proc) test/Garnet.test/Extensions/SortedSetCountTxn.cs.

We can also use this PR as a template for how to add API calls to IGarnetApi in future:

  • Add method signature to IGarnetApi or IGarnetReadApi interface
  • Add implementation of API to StorageSession (e.g. SortedSetOps.cs)
  • Add forwarder methods to GarnetApi and GarnetWatchApi (if it is a read operation) struct wrappers

Fixes #979

Use it in test custom transaction (stored proc)
@badrishc badrishc requested a review from TalZaccai January 30, 2025 18:32
@badrishc badrishc merged commit a63ad80 into main Feb 3, 2025
15 checks passed
@badrishc badrishc deleted the badrishc/sorted-set-count-txn branch February 3, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SortedSetCount to IGarnetApi
2 participants