Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move IoBuf to vortex-io #1714

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading