@@ -70,7 +70,7 @@ impl Default for StorageMetadata {
7070 Self {
7171 version : CURRENT_STORAGE_METADATA_VERSION . to_string ( ) ,
7272 mode : PARSEABLE . storage . name ( ) . to_owned ( ) ,
73- staging : PARSEABLE . staging_dir ( ) . to_path_buf ( ) ,
73+ staging : PARSEABLE . options . staging_dir ( ) . to_path_buf ( ) ,
7474 storage : PARSEABLE . storage . get_endpoint ( ) ,
7575 deployment_id : uid:: gen ( ) ,
7676 server_mode : PARSEABLE . options . mode ,
@@ -134,8 +134,8 @@ pub async fn resolve_parseable_metadata(
134134 if metadata. server_mode == Mode :: All && PARSEABLE . options . mode == Mode :: Ingest {
135135 Err ( "Starting Ingest Mode is not allowed, Since Query Server has not been started yet" )
136136 } else {
137- create_dir_all ( PARSEABLE . staging_dir ( ) ) ?;
138- metadata. staging = PARSEABLE . staging_dir ( ) . canonicalize ( ) ?;
137+ create_dir_all ( PARSEABLE . options . staging_dir ( ) ) ?;
138+ metadata. staging = PARSEABLE . options . staging_dir ( ) . canonicalize ( ) ?;
139139 // this flag is set to true so that metadata is copied to staging
140140 overwrite_staging = true ;
141141 // overwrite remote in all and query mode
@@ -151,20 +151,20 @@ pub async fn resolve_parseable_metadata(
151151 Mode :: Query => {
152152 overwrite_remote = true ;
153153 metadata. server_mode = PARSEABLE . options . mode ;
154- metadata. staging = PARSEABLE . staging_dir ( ) . to_path_buf ( ) ;
154+ metadata. staging = PARSEABLE . options . staging_dir ( ) . to_path_buf ( ) ;
155155 } ,
156156 Mode :: Ingest => {
157157 // if ingest server is started fetch the metadata from remote
158158 // update the server mode for local metadata
159159 metadata. server_mode = PARSEABLE . options . mode ;
160- metadata. staging = PARSEABLE . staging_dir ( ) . to_path_buf ( ) ;
160+ metadata. staging = PARSEABLE . options . staging_dir ( ) . to_path_buf ( ) ;
161161 } ,
162162 }
163163 Ok ( metadata)
164164 }
165165 }
166166 EnvChange :: CreateBoth => {
167- create_dir_all ( PARSEABLE . staging_dir ( ) ) ?;
167+ create_dir_all ( PARSEABLE . options . staging_dir ( ) ) ?;
168168 let metadata = StorageMetadata :: default ( ) ;
169169 // new metadata needs to be set
170170 // if mode is query or all then both staging and remote
@@ -237,7 +237,8 @@ pub enum EnvChange {
237237}
238238
239239pub fn get_staging_metadata ( ) -> io:: Result < Option < StorageMetadata > > {
240- let path = RelativePathBuf :: from ( PARSEABLE_METADATA_FILE_NAME ) . to_path ( PARSEABLE . staging_dir ( ) ) ;
240+ let path = RelativePathBuf :: from ( PARSEABLE_METADATA_FILE_NAME )
241+ . to_path ( PARSEABLE . options . staging_dir ( ) ) ;
241242 let bytes = match fs:: read ( path) {
242243 Ok ( bytes) => bytes,
243244 Err ( err) => match err. kind ( ) {
@@ -259,8 +260,11 @@ pub async fn put_remote_metadata(metadata: &StorageMetadata) -> Result<(), Objec
259260pub fn put_staging_metadata ( meta : & StorageMetadata ) -> io:: Result < ( ) > {
260261 let mut staging_metadata = meta. clone ( ) ;
261262 staging_metadata. server_mode = PARSEABLE . options . mode ;
262- staging_metadata. staging = PARSEABLE . staging_dir ( ) . to_path_buf ( ) ;
263- let path = PARSEABLE . staging_dir ( ) . join ( PARSEABLE_METADATA_FILE_NAME ) ;
263+ staging_metadata. staging = PARSEABLE . options . staging_dir ( ) . to_path_buf ( ) ;
264+ let path = PARSEABLE
265+ . options
266+ . staging_dir ( )
267+ . join ( PARSEABLE_METADATA_FILE_NAME ) ;
264268 let mut file = OpenOptions :: new ( )
265269 . create ( true )
266270 . truncate ( true )
0 commit comments