Skip to content

Commit

Permalink
shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 committed Oct 17, 2024
1 parent 4132d56 commit 0b4e10b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vortex-serde/src/layouts/read/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl FooterReader {
}

let ps = root::<vortex_flatbuffers::footer::Postscript>(
&buf[magic_bytes_loc - 32..magic_bytes_loc],
&buf[magic_bytes_loc - (FILE_POSTSCRIPT_SIZE - MAGIC_BYTES.len())..magic_bytes_loc],
)?;

Ok(Footer {
Expand Down
8 changes: 4 additions & 4 deletions vortex-serde/src/layouts/read/layouts/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use vortex_flatbuffers::footer;

use crate::layouts::read::cache::RelativeLayoutCache;
use crate::layouts::{
LayoutDeserializer, LayoutId, LayoutReader, LayoutSpec, Messages, ReadResult, Scan,
LayoutDeserializer, LayoutId, LayoutReader, LayoutSpec, Message, ReadResult, Scan,
};
use crate::message_reader::ArrayBufferReader;
use crate::stream_writer::ByteRange;
Expand Down Expand Up @@ -92,8 +92,8 @@ impl FlatLayout {
}
}

fn own_message(&self) -> Messages {
vec![(self.cache.absolute_id(&[]), self.range)]
fn own_message(&self) -> Message {
(self.cache.absolute_id(&[]), self.range)
}

fn array_from_bytes(&self, mut buf: Bytes) -> VortexResult<Array> {
Expand Down Expand Up @@ -128,7 +128,7 @@ impl LayoutReader for FlatLayout {
self.cached_array = Some(self.array_from_bytes(buf)?);
self.read_next()
} else {
Ok(Some(ReadResult::ReadMore(self.own_message())))
Ok(Some(ReadResult::ReadMore(vec![self.own_message()])))
}
}
}
4 changes: 2 additions & 2 deletions vortex-serde/src/layouts/read/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ pub struct Scan {
/// Unique identifier for a message within a layout
pub type LayoutPartId = u16;
pub type MessageId = Vec<LayoutPartId>;
pub type Messages = Vec<(MessageId, ByteRange)>;
pub type Message = (MessageId, ByteRange);

#[derive(Debug)]
pub enum ReadResult {
ReadMore(Messages),
ReadMore(Vec<Message>),
Batch(Array),
}

Expand Down

0 comments on commit 0b4e10b

Please sign in to comment.