-
Notifications
You must be signed in to change notification settings - Fork 696
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
[ADDED] ListKeys method for listing kv keys #1490
Conversation
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@@ -67,7 +67,10 @@ type ( | |||
// WatchAll will invoke the callback for all updates. | |||
WatchAll(ctx context.Context, opts ...WatchOpt) (KeyWatcher, error) | |||
// Keys will return all keys. | |||
// DEPRECATED: Use ListKeys instead to avoid memory issues. |
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.
which was the memory issue?
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.
Keys()
could be used to fetch millions of keys all stored in a slice before returning. There should be a way of either paging or iterating over the result (which the new method provides). I could add some details to this comment.
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.
Have a use case now with > 600k keys.
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.
ah I see, makes sense to switch to use channels instead
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.
LGTM
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.
LGTM.
Will add note to ADR that such scalable method should be available in all clients, if any without iterators had similar approach.
Signed-off-by: Piotr Piotrowski piotr@synadia.com