forked from valkey-io/valkey-glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java: Cluster SCAN request (valkey-io#1737)
* Added Scan logic to Glide-core * added scan to python * added changes to changelog * fixed comments * changed from hash to nanoid * fixed typing * fixed comments * Stubbing for cluster scan * Update ScanOptions Signed-off-by: Andrew Carbonetto <[email protected]> * ClusterScan implementation Notes: - ClusterScanCursor is an interface end users should work with. It is in a package exposed in the module. - NativeClusterScanCursor is an implementation of the above that is in an internal package. It wraps Rust cursor strings. - RedisClusterClient intercepts the result from Rust to wrap the cursor string in a NativeClusterScanCursor - The caller is responsible for closing ClusterScanCursor. If they don't, it'll get cleaned up at GC-time, but this is non-deterministic. * Make cursor termination behave as Python does Look for the "finished" string * Unrelated: avoid double-dropping of scripts The same hash could potentially be reused. * Better state management of cursors * Validate that either the initial cursor is used, or an unfinished cursor. * Test-by-reference for the initial cursor instead of evaluating its string. * Clean-up unfinished cursors if they get re-used in scan. * Throw errors if a finished cursor is passed to scan. * Update design for an iterative cursor - The cursor object manages updating cursor handles and internal state - It auto-cleans at the end of the data - The user can also dispose of the cursor early * Change the API to match Python * Unit tests * Fix integration tests When using the ScanOptions type, pass native names through to the rust layer when using cluster scans, and enum names when using standalone scans. * Integration test for cluster scan options * Spotless * Add more integration tests Also flushall before each test to avoid flakiness from leftover state * Move population of the ScanOptions protobuf to CommandManager * Rename clusterScan() method to scan() For consistency with Python * Add javadoc comments * Spotless * Abstract the cursor string from the public API Move access to this to an internal detail interface. The user shouldn't need this string themselves. * Spotless * Revert accidental changes resolve conflicts * Address review comments * Get protocol string constants from Rust instead of hard-coding them * Add integration testing for the Stream type filter * Spotless * Update scan documentation Signed-off-by: Andrew Carbonetto <[email protected]> --------- Signed-off-by: Andrew Carbonetto <[email protected]> Co-authored-by: avifenesh <[email protected]> Co-authored-by: Andrew Carbonetto <[email protected]>
- Loading branch information
Showing
14 changed files
with
1,243 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.