@@ -67,7 +67,7 @@ impl FilesystemStore {
6767 }
6868 }
6969
70- fn get_dest_dir_path ( & self , namespace : & str , sub_namespace : & str ) -> std:: io:: Result < PathBuf > {
70+ fn get_dest_dir_path ( & self , primary_namespace : & str , secondary_namespace : & str ) -> std:: io:: Result < PathBuf > {
7171 let mut dest_dir_path = {
7272 #[ cfg( target_os = "windows" ) ]
7373 {
@@ -81,20 +81,20 @@ impl FilesystemStore {
8181 }
8282 } ;
8383
84- dest_dir_path. push ( namespace ) ;
85- if !sub_namespace . is_empty ( ) {
86- dest_dir_path. push ( sub_namespace ) ;
84+ dest_dir_path. push ( primary_namespace ) ;
85+ if !secondary_namespace . is_empty ( ) {
86+ dest_dir_path. push ( secondary_namespace ) ;
8787 }
8888
8989 Ok ( dest_dir_path)
9090 }
9191}
9292
9393impl KVStore for FilesystemStore {
94- fn read ( & self , namespace : & str , sub_namespace : & str , key : & str ) -> std:: io:: Result < Vec < u8 > > {
95- check_namespace_key_validity ( namespace , sub_namespace , Some ( key) , "read" ) ?;
94+ fn read ( & self , primary_namespace : & str , secondary_namespace : & str , key : & str ) -> std:: io:: Result < Vec < u8 > > {
95+ check_namespace_key_validity ( primary_namespace , secondary_namespace , Some ( key) , "read" ) ?;
9696
97- let mut dest_file_path = self . get_dest_dir_path ( namespace , sub_namespace ) ?;
97+ let mut dest_file_path = self . get_dest_dir_path ( primary_namespace , secondary_namespace ) ?;
9898 dest_file_path. push ( key) ;
9999
100100 let mut buf = Vec :: new ( ) ;
@@ -114,10 +114,10 @@ impl KVStore for FilesystemStore {
114114 Ok ( buf)
115115 }
116116
117- fn write ( & self , namespace : & str , sub_namespace : & str , key : & str , buf : & [ u8 ] ) -> std:: io:: Result < ( ) > {
118- check_namespace_key_validity ( namespace , sub_namespace , Some ( key) , "write" ) ?;
117+ fn write ( & self , primary_namespace : & str , secondary_namespace : & str , key : & str , buf : & [ u8 ] ) -> std:: io:: Result < ( ) > {
118+ check_namespace_key_validity ( primary_namespace , secondary_namespace , Some ( key) , "write" ) ?;
119119
120- let mut dest_file_path = self . get_dest_dir_path ( namespace , sub_namespace ) ?;
120+ let mut dest_file_path = self . get_dest_dir_path ( primary_namespace , secondary_namespace ) ?;
121121 dest_file_path. push ( key) ;
122122
123123 let parent_directory = dest_file_path
@@ -201,10 +201,10 @@ impl KVStore for FilesystemStore {
201201 res
202202 }
203203
204- fn remove ( & self , namespace : & str , sub_namespace : & str , key : & str , lazy : bool ) -> std:: io:: Result < ( ) > {
205- check_namespace_key_validity ( namespace , sub_namespace , Some ( key) , "remove" ) ?;
204+ fn remove ( & self , primary_namespace : & str , secondary_namespace : & str , key : & str , lazy : bool ) -> std:: io:: Result < ( ) > {
205+ check_namespace_key_validity ( primary_namespace , secondary_namespace , Some ( key) , "remove" ) ?;
206206
207- let mut dest_file_path = self . get_dest_dir_path ( namespace , sub_namespace ) ?;
207+ let mut dest_file_path = self . get_dest_dir_path ( primary_namespace , secondary_namespace ) ?;
208208 dest_file_path. push ( key) ;
209209
210210 if !dest_file_path. is_file ( ) {
@@ -290,10 +290,10 @@ impl KVStore for FilesystemStore {
290290 Ok ( ( ) )
291291 }
292292
293- fn list ( & self , namespace : & str , sub_namespace : & str ) -> std:: io:: Result < Vec < String > > {
294- check_namespace_key_validity ( namespace , sub_namespace , None , "list" ) ?;
293+ fn list ( & self , primary_namespace : & str , secondary_namespace : & str ) -> std:: io:: Result < Vec < String > > {
294+ check_namespace_key_validity ( primary_namespace , secondary_namespace , None , "list" ) ?;
295295
296- let prefixed_dest = self . get_dest_dir_path ( namespace , sub_namespace ) ?;
296+ let prefixed_dest = self . get_dest_dir_path ( primary_namespace , secondary_namespace ) ?;
297297 let mut keys = Vec :: new ( ) ;
298298
299299 if !Path :: new ( & prefixed_dest) . exists ( ) {
@@ -320,17 +320,17 @@ impl KVStore for FilesystemStore {
320320
321321 let metadata = p. metadata ( ) ?;
322322
323- // We allow the presence of directories in the empty namespace and just skip them.
323+ // We allow the presence of directories in the empty primary namespace and just skip them.
324324 if metadata. is_dir ( ) {
325325 continue ;
326326 }
327327
328328 // If we otherwise don't find a file at the given path something went wrong.
329329 if !metadata. is_file ( ) {
330330 debug_assert ! ( false , "Failed to list keys of {}/{}: file couldn't be accessed." ,
331- PrintableString ( namespace ) , PrintableString ( sub_namespace ) ) ;
331+ PrintableString ( primary_namespace ) , PrintableString ( secondary_namespace ) ) ;
332332 let msg = format ! ( "Failed to list keys of {}/{}: file couldn't be accessed." ,
333- PrintableString ( namespace ) , PrintableString ( sub_namespace ) ) ;
333+ PrintableString ( primary_namespace ) , PrintableString ( secondary_namespace ) ) ;
334334 return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , msg) ) ;
335335 }
336336
@@ -342,17 +342,17 @@ impl KVStore for FilesystemStore {
342342 }
343343 } else {
344344 debug_assert ! ( false , "Failed to list keys of {}/{}: file path is not valid UTF-8" ,
345- PrintableString ( namespace ) , PrintableString ( sub_namespace ) ) ;
345+ PrintableString ( primary_namespace ) , PrintableString ( secondary_namespace ) ) ;
346346 let msg = format ! ( "Failed to list keys of {}/{}: file path is not valid UTF-8" ,
347- PrintableString ( namespace ) , PrintableString ( sub_namespace ) ) ;
347+ PrintableString ( primary_namespace ) , PrintableString ( secondary_namespace ) ) ;
348348 return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , msg) ) ;
349349 }
350350 }
351351 Err ( e) => {
352352 debug_assert ! ( false , "Failed to list keys of {}/{}: {}" ,
353- PrintableString ( namespace ) , PrintableString ( sub_namespace ) , e) ;
353+ PrintableString ( primary_namespace ) , PrintableString ( secondary_namespace ) , e) ;
354354 let msg = format ! ( "Failed to list keys of {}/{}: {}" ,
355- PrintableString ( namespace ) , PrintableString ( sub_namespace ) , e) ;
355+ PrintableString ( primary_namespace ) , PrintableString ( secondary_namespace ) , e) ;
356356 return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , msg) ) ;
357357 }
358358 }
0 commit comments