fresh-borzoni commented on code in PR #127:
URL: https://github.com/apache/fluss-rust/pull/127#discussion_r2666918914
##########
crates/fluss/src/client/table/scanner.rs:
##########
@@ -171,10 +182,32 @@ impl LogScanner {
log_scanner_status.clone(),
projected_fields,
)?,
+ poll_mode: AtomicU8::new(POLL_MODE_UNSET),
})
}
pub async fn poll(&self, timeout: Duration) -> Result<ScanRecords> {
+ // Check and set poll mode to prevent mixing with poll_batches
+ match self.poll_mode.compare_exchange(
Review Comment:
> Checking and erroring during runtime which opens up possibility of user
error, is there a way to enforce polling of ScanRecords/RecordBatch through
compile time means alone?
>
> An example would be a trait with poll() which returns parameterised type.
The arrow RecordBatch implementation's poll returns RecordBatch. User then can
then initialise ArrowRecordBatchLogScanner if they want to use the RecordBatch
variant.
Yes, it might be a good idea, to split it completely, i just prioritised to
add new function in the least obtrusive way, but let me see how it would look
like with this suggestion.
Thank you!
--
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]