zuston commented on issue #311:
URL: https://github.com/apache/fluss-rust/issues/311#issuecomment-3900411014
> On a related note, the community is currently considering providing a KV
scan interface. The idea is to have the server return pre-deduplicated data
directly, rather than handling the merge and deduplication on the client side.
I seen the similar java client implementation in fluss client module for KV
limit scan.
> I'm a bit confused related to duplication in scanners, we only have
LogScanner and RecordBatchLogScanner, they share LogScannerInner and the only
difference in poll methods - poll_records and poll_batches.
That said we don't have any limit batch scanner or KvScanner, and it's
probably what you are looking for.
From my point, the current implementation looks a bit complex. Maybe we
could extract some same place to do a good abstraction like the following code.
@fresh-borzoni
```rust
pub trait BatchScanner<T> {
fn poll(&mut self, timeout: Duration) -> impl Future<Output = Result<T>>
+ Send;
fn close(&mut self) -> Result<()>;
}
struct ScanOptions {
pub projected_fields: Option<Vec<usize>>,
pub limit: Option<i32>,
pub batch_result_type: BatchReturnType,
// more extend options
}
enum BatchReturnType {
RECORD,
xxxxx,
}
struct KvBatchScanner {
options: ScanOptions,
}
impl BatchScanner for KvBatchScanner {
xxxxxxxxxxxx
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]