@@ -2,7 +2,7 @@ use std::fs::File;
22use std:: ops:: Range ;
33use std:: path:: { Path , PathBuf } ;
44use std:: process:: Command ;
5- use std:: sync:: Arc ;
5+ use std:: sync:: { Arc , LazyLock } ;
66
77use arrow_array:: types:: Int64Type ;
88use arrow_array:: {
@@ -27,11 +27,16 @@ use vortex::arrow::FromArrowType;
2727use vortex:: compress:: CompressionStrategy ;
2828use vortex:: dtype:: DType ;
2929use vortex:: error:: VortexResult ;
30- use vortex:: file:: { LayoutContext , LayoutDeserializer , VortexFileWriter , VortexReadBuilder } ;
30+ use vortex:: file:: {
31+ IoDispatcher , LayoutContext , LayoutDeserializer , VortexFileWriter , VortexReadBuilder ,
32+ } ;
3133use vortex:: io:: { ObjectStoreReadAt , TokioFile , VortexReadAt , VortexWrite } ;
3234use vortex:: sampling_compressor:: { SamplingCompressor , ALL_ENCODINGS_CONTEXT } ;
3335use vortex:: { Array , IntoArray , IntoCanonical } ;
3436
37+ static DISPATCHER : LazyLock < Arc < IoDispatcher > > =
38+ LazyLock :: new ( || Arc :: new ( IoDispatcher :: new_tokio ( 1 ) ) ) ;
39+
3540pub const BATCH_SIZE : usize = 65_536 ;
3641
3742#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -51,6 +56,7 @@ pub async fn open_vortex(path: &Path) -> VortexResult<Array> {
5156 LayoutContext :: default ( ) . into ( ) ,
5257 ) ,
5358 )
59+ . with_io_dispatcher ( DISPATCHER . clone ( ) )
5460 . build ( )
5561 . await ?
5662 . read_all ( )
0 commit comments