Skip to content

Commit

Permalink
chore: AsyncReader use BufReader
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Nov 6, 2024
1 parent 77b3b1a commit 5083069
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fusio-parquet/src/reader.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{cmp, ops::Range, sync::Arc};

use bytes::{Bytes, BytesMut};
use fusio::{dynamic::DynFile, Read};
use fusio::{buffered::BufReader, dynamic::DynFile, Read};
use futures::{future::BoxFuture, FutureExt};
use parquet::{
arrow::async_reader::AsyncFileReader,
Expand All @@ -15,7 +15,7 @@ use parquet::{
const PREFETCH_FOOTER_SIZE: usize = 512 * 1024;

pub struct AsyncReader {
inner: Box<dyn DynFile>,
inner: BufReader<Box<dyn DynFile>>,
content_length: u64,
// The prefetch size for fetching file footer.
prefetch_footer_size: usize,
Expand All @@ -29,7 +29,7 @@ fn set_prefetch_footer_size(footer_size: usize, content_size: u64) -> usize {
impl AsyncReader {
pub async fn new(reader: Box<dyn DynFile>, content_length: u64) -> Result<Self, fusio::Error> {
Ok(Self {
inner: reader,
inner: BufReader::new(reader, 512 * 1024),
content_length,
prefetch_footer_size: set_prefetch_footer_size(PREFETCH_FOOTER_SIZE, content_length),
})
Expand Down

0 comments on commit 5083069

Please sign in to comment.