From 6877f1d163d1eda44dd5001bf3aa5ffa577f5504 Mon Sep 17 00:00:00 2001 From: Onur Satici Date: Tue, 21 Jul 2026 14:03:21 +0100 Subject: [PATCH 1/2] Remove mutable state from Vortex open options Signed-off-by: Onur Satici --- vortex-file/src/open.rs | 61 ++++++++++++++++++------------- vortex-file/src/segments/cache.rs | 5 +-- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/vortex-file/src/open.rs b/vortex-file/src/open.rs index d5d60b700e5..2f40ca57804 100644 --- a/vortex-file/src/open.rs +++ b/vortex-file/src/open.rs @@ -4,7 +4,6 @@ use std::sync::Arc; use futures::executor::block_on; -use parking_lot::RwLock; use vortex_array::dtype::DType; use vortex_array::memory::MemorySessionExt; use vortex_array::session::ArraySessionExt; @@ -41,6 +40,11 @@ use crate::segments::RequestMetrics; const INITIAL_READ_SIZE: usize = MAX_POSTSCRIPT_SIZE as usize + EOF_SIZE; +struct FooterRead { + footer: Footer, + initial_segments: HashMap, +} + /// Open options for a Vortex file reader. /// /// Options are session-bound because opening a file may need array, layout, dtype, runtime, and @@ -48,6 +52,7 @@ const INITIAL_READ_SIZE: usize = MAX_POSTSCRIPT_SIZE as usize + EOF_SIZE; /// /// The opener first resolves a [`Footer`], then creates a segment source for later scans. Known /// file metadata can be supplied up front to avoid IO during footer discovery. +#[derive(Clone)] pub struct VortexOpenOptions { /// The session to use for opening the file. session: VortexSession, @@ -61,8 +66,6 @@ pub struct VortexOpenOptions { dtype: Option, /// An optional, externally provided, file layout. footer: Option