#[derive(Debug, Clone)]
pub struct ReadOptions {
pub ignore_metadata_errors: bool,
pub max_payload_bytes: u64,
pub validate_layout: bool,
pub sequential_io: bool,
pub parallel_decode: bool,
pub stream_chunk_size: usize,
pub compact_timestamps: bool,
}
impl Default for ReadOptions {
fn default() -> Self {
Self {
ignore_metadata_errors: false,
max_payload_bytes: 512 * 1024 * 1024, validate_layout: true,
sequential_io: true,
parallel_decode: false,
stream_chunk_size: 4096,
compact_timestamps: false,
}
}
}
impl ReadOptions {
pub fn new() -> Self {
Self::default()
}
pub fn ignore_metadata_errors(mut self, ignore: bool) -> Self {
self.ignore_metadata_errors = ignore;
self
}
pub fn max_payload_bytes(mut self, bytes: u64) -> Self {
self.max_payload_bytes = bytes;
self
}
pub fn validate_layout(mut self, validate: bool) -> Self {
self.validate_layout = validate;
self
}
pub fn sequential_io(mut self, sequential: bool) -> Self {
self.sequential_io = sequential;
self
}
pub fn parallel_decode(mut self, parallel: bool) -> Self {
self.parallel_decode = parallel;
self
}
pub fn stream_chunk_size(mut self, size: usize) -> Self {
self.stream_chunk_size = size.max(1);
self
}
pub fn compact_timestamps(mut self, compact: bool) -> Self {
self.compact_timestamps = compact;
self
}
}