tustvold commented on code in PR #5753:
URL: https://github.com/apache/arrow-rs/pull/5753#discussion_r1597482498
##########
parquet/src/arrow/async_writer/mod.rs:
##########
@@ -59,13 +59,59 @@ use crate::{
};
use arrow_array::RecordBatch;
use arrow_schema::SchemaRef;
+use bytes::Bytes;
+use futures::future::BoxFuture;
+use futures::FutureExt;
use tokio::io::{AsyncWrite, AsyncWriteExt};
-/// Encodes [`RecordBatch`] to parquet, outputting to an [`AsyncWrite`]
+/// The asynchronous interface used by [`AsyncArrowWriter`] to write parquet
files
+pub trait AsyncFileWriter: Send {
+ /// Write the provided bytes to the underlying writer
+ ///
+ /// The underlying writer CAN decide to buffer the data or write it
immediately.
+ /// This design allows the writer implementer to control the buffering and
I/O scheduling.
+ fn write(&mut self, bs: Bytes) -> BoxFuture<'_, Result<()>>;
Review Comment:
We should document atomicity requirements for this method
--
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]