vortex_layout/segments/
sink.rs

1use vortex_buffer::ByteBuffer;
2
3use crate::segments::SegmentId;
4
5pub trait SegmentWriter {
6    /// Write the given data into a segment and return its identifier.
7    /// The provided buffers are concatenated together to form the segment.
8    ///
9    // TODO(ngates): in order to support aligned Direct I/O, it is preferable for all segments to
10    //  be aligned to the logical block size (typically 512, but could be 4096). For this reason,
11    //  if we know we're going to read an entire FlatLayout together, then we should probably
12    //  serialize it into a single segment that is 512 byte aligned? Or else, we should guarantee
13    //  to align the the first segment to 512, and then assume that coalescing captures the rest.
14    fn put(&mut self, buffer: &[ByteBuffer]) -> SegmentId;
15}