You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "thinkharderdev (via GitHub)" <gi...@apache.org> on 2023/03/28 14:59:30 UTC

[GitHub] [arrow-rs] thinkharderdev commented on a diff in pull request #3967: Async writer tweaks

thinkharderdev commented on code in PR #3967:
URL: https://github.com/apache/arrow-rs/pull/3967#discussion_r1150759812


##########
parquet/src/arrow/async_writer/mod.rs:
##########
@@ -135,64 +135,68 @@ impl<W: AsyncWrite + Unpin + Send> AsyncArrowWriter<W> {
         let metadata = self.sync_writer.close()?;
 
         // Force to flush the remaining data.
-        Self::try_flush(&self.shared_buffer, &mut self.async_writer, 0).await?;
+        Self::try_flush(&mut self.shared_buffer, &mut self.async_writer, 0).await?;
 
         Ok(metadata)
     }
 
     /// Flush the data in the [`SharedBuffer`] into the `async_writer` if its size
     /// exceeds the threshold.
     async fn try_flush(
-        shared_buffer: &SharedBuffer,
+        shared_buffer: &mut SharedBuffer,

Review Comment:
   Could we actually just remove the `Mutex` entirely? Hold a `Arc<SharedBuffer>` and use `Arc::get_mut` to grab a mutable reference



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org