vortex_file/v2/
strategy.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! This module defines the default layout strategy for a Vortex file.

use vortex_dtype::DType;
use vortex_error::VortexResult;
use vortex_layout::layouts::chunked::writer::{ChunkedLayoutOptions, ChunkedLayoutWriter};
use vortex_layout::strategies::{LayoutStrategy, LayoutWriter, LayoutWriterExt};

/// The default Vortex file layout strategy.
///
/// The current implementation is a placeholder and needs to be fleshed out.
pub struct VortexLayoutStrategy;

impl LayoutStrategy for VortexLayoutStrategy {
    fn new_writer(&self, dtype: &DType) -> VortexResult<Box<dyn LayoutWriter>> {
        Ok(ChunkedLayoutWriter::new(dtype, ChunkedLayoutOptions::default()).boxed())
    }
}