-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add the unlink command #4
Conversation
var deleteFutures = | ||
Arrays.stream(ks) | ||
.map(k -> client.delete(cacheName, codec.encodeKeyToBytes(k))) | ||
.collect(Collectors.toList()); |
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.
Because many Redis commands are variadic and batch oriented, we need to fan out to Momento.
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.
this will have thread pool implications. We should extract this type of logic to a common helper function that we channel all of these types of batching operations through, so that we can add more explicit concurrency controls to it in the future if we need to. We don't need to solve the concurrency issues as part of this initial spike though.
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.
@nand4011 we may wanna pull you into this re: concurrency stuff at some point. For now I'd just like to abstract it to a single place so we can easily change the behavior later but if any specific concurrency issues come up your recent experience in the java sdk repo will be relevant.
var deleteFutures = | ||
Arrays.stream(ks) | ||
.map(k -> client.delete(cacheName, codec.encodeKeyToBytes(k))) | ||
.collect(Collectors.toList()); |
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.
this will have thread pool implications. We should extract this type of logic to a common helper function that we channel all of these types of batching operations through, so that we can add more explicit concurrency controls to it in the future if we need to. We don't need to solve the concurrency issues as part of this initial spike though.
Unlink is a Redis command similar to delete.
I rebased so no changes @cprice404 . @rishtigupta or @nand4011 any comments about the future concurrency work? |
You don't need to do it in this PR but before you perpetuate that |
Adds the Lettuce
unlink
command, which is similar todelete
. Because the command takes variadic arguments, we fan out the delete requests. In the future we can hook up our rate limiting to this section.