Skip to content

Commit

Permalink
chore: move IoBuf to vortex-io (#1714)
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn authored Dec 18, 2024
1 parent 6e7f731 commit d6a2475
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions bench-vortex/src/taxi_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use std::io::Write;
use std::path::PathBuf;

use futures::executor::block_on;
use vortex::buffer::io_buf::IoBuf;
use vortex::error::VortexError;
use vortex::io::VortexWrite;
use vortex::io::{IoBuf, VortexWrite};

use crate::data_downloads::{data_vortex_uncompressed, download_data};
use crate::reader::rewrite_parquet_as_vortex;
Expand Down
1 change: 0 additions & 1 deletion vortex-buffer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use arrow_buffer::{ArrowNativeType, Buffer as ArrowBuffer, MutableBuffer as Arro
pub use string::*;

mod flexbuffers;
pub mod io_buf;
mod string;

/// Buffer is an owned, cheaply cloneable byte array.
Expand Down
3 changes: 1 addition & 2 deletions vortex-buffer/src/io_buf.rs → vortex-io/src/io_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
use std::ops::Range;

use bytes::Bytes;

use crate::Buffer;
use vortex_buffer::Buffer;

/// Trait for types that can provide a readonly byte buffer interface to I/O frameworks.
///
Expand Down
2 changes: 2 additions & 0 deletions vortex-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
pub use buf::*;
pub use dispatcher::*;
pub use io_buf::*;
pub use limit::*;
#[cfg(feature = "object_store")]
pub use object_store::*;
Expand All @@ -23,6 +24,7 @@ mod buf;
#[cfg(feature = "compio")]
mod compio;
mod dispatcher;
mod io_buf;
mod limit;
#[cfg(feature = "object_store")]
mod object_store;
Expand Down
3 changes: 1 addition & 2 deletions vortex-io/src/object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ use bytes::Bytes;
use futures_util::StreamExt;
use object_store::path::Path;
use object_store::{GetOptions, GetRange, GetResultPayload, ObjectStore, WriteMultipart};
use vortex_buffer::io_buf::IoBuf;
use vortex_buffer::Buffer;
use vortex_error::{VortexExpect, VortexResult, VortexUnwrap};

use crate::aligned::AlignedBytesMut;
use crate::{VortexBufReader, VortexReadAt, VortexWrite, ALIGNMENT};
use crate::{IoBuf, VortexBufReader, VortexReadAt, VortexWrite, ALIGNMENT};

pub trait ObjectStoreExt {
fn vortex_read(
Expand Down
3 changes: 1 addition & 2 deletions vortex-io/src/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ use std::sync::Arc;

use bytes::Bytes;
use tokio::io::{AsyncWrite, AsyncWriteExt};
use vortex_buffer::io_buf::IoBuf;
use vortex_error::VortexUnwrap;

use crate::aligned::AlignedBytesMut;
use crate::{VortexReadAt, VortexWrite, ALIGNMENT};
use crate::{IoBuf, VortexReadAt, VortexWrite, ALIGNMENT};

pub struct TokioAdapter<IO>(pub IO);

Expand Down
2 changes: 1 addition & 1 deletion vortex-io/src/write.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::future::{ready, Future};
use std::io::{self, Cursor, Write};

use vortex_buffer::io_buf::IoBuf;
use crate::IoBuf;

pub trait VortexWrite {
fn write_all<B: IoBuf>(&mut self, buffer: B) -> impl Future<Output = io::Result<B>>;
Expand Down

0 comments on commit d6a2475

Please sign in to comment.