-
Notifications
You must be signed in to change notification settings - Fork 67
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
Java: add scan (binary) for cluster commands #1837
Changes from all commits
97a536b
ea49a70
d85a6c9
31e1be2
a52ed9f
b0efd67
d1ae1fc
f7ae2e8
8739a37
8534e88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1064,6 +1064,14 @@ public CompletableFuture<Object[]> scan(ClusterScanCursor cursor) { | |
result -> new Object[] {new NativeClusterScanCursor(result[0].toString()), result[1]}); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<Object[]> scanBinary(ClusterScanCursor cursor) { | ||
return commandManager | ||
.submitClusterScan(cursor, ScanOptions.builder().build(), this::handleArrayResponseBinary) | ||
.thenApply( | ||
result -> new Object[] {new NativeClusterScanCursor(result[0].toString()), result[1]}); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<Object[]> scan(ClusterScanCursor cursor, ScanOptions options) { | ||
return commandManager | ||
|
@@ -1072,6 +1080,14 @@ public CompletableFuture<Object[]> scan(ClusterScanCursor cursor, ScanOptions op | |
result -> new Object[] {new NativeClusterScanCursor(result[0].toString()), result[1]}); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<Object[]> scanBinary(ClusterScanCursor cursor, ScanOptions options) { | ||
return commandManager | ||
.submitClusterScan(cursor, options, this::handleArrayResponseBinary) | ||
.thenApply( | ||
result -> new Object[] {new NativeClusterScanCursor(result[0].toString()), result[1]}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is fine, but I'd be curious if the Rust layer can ever return non-UTF-8 binary data. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the cursor...? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I was thinking that too. |
||
} | ||
|
||
@Override | ||
public CompletableFuture<String[]> sort( | ||
@NonNull String key, @NonNull SortClusterOptions sortClusterOptions) { | ||
|
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.
I afraid you need new class
ScanOptionsBinary
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.
The Binary options are useless and don't provide any additional benefit. They are phasing them out.
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.
There is
String matchPattern
unfortunatelyThere 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.
protobuf doesn't accept anything but strings, so we cannot sent binary scan options