@@ -66,8 +66,7 @@ use super::{
6666{all-args}
6767"
6868) ]
69-
70- pub struct GCSConfig {
69+ pub struct GcsConfig {
7170 /// The endpoint to GCS or compatible object storage platform
7271 #[ arg(
7372 long,
@@ -90,14 +89,14 @@ pub struct GCSConfig {
9089 /// Set client to skip tls verification
9190 #[ arg(
9291 long,
93- env = "P_S3_TLS_SKIP_VERIFY " ,
92+ env = "P_GCS_TLS_SKIP_VERIFY " ,
9493 value_name = "bool" ,
9594 default_value = "false"
9695 ) ]
9796 pub skip_tls : bool ,
9897}
9998
100- impl GCSConfig {
99+ impl GcsConfig {
101100 fn get_default_builder ( & self ) -> GoogleCloudStorageBuilder {
102101 let mut client_options = ClientOptions :: default ( )
103102 . with_allow_http ( true )
@@ -121,7 +120,7 @@ impl GCSConfig {
121120 }
122121}
123122
124- impl ObjectStorageProvider for GCSConfig {
123+ impl ObjectStorageProvider for GcsConfig {
125124 fn name ( & self ) -> & ' static str {
126125 "gcs"
127126 }
@@ -134,6 +133,8 @@ impl ObjectStorageProvider for GCSConfig {
134133 let gcs = MetricLayer :: new ( gcs) ;
135134
136135 let object_store_registry = DefaultObjectStoreRegistry :: new ( ) ;
136+ // Register GCS client under the "s3://" scheme so DataFusion can route
137+ // object store calls to our GoogleCloudStorage implementatio
137138 let url = ObjectStoreUrl :: parse ( format ! ( "s3://{}" , & self . bucket_name) ) . unwrap ( ) ;
138139 object_store_registry. register_store ( url. as_ref ( ) , Arc :: new ( gcs) ) ;
139140
@@ -143,7 +144,7 @@ impl ObjectStorageProvider for GCSConfig {
143144 fn construct_client ( & self ) -> Arc < dyn ObjectStorage > {
144145 let gcs = self . get_default_builder ( ) . build ( ) . unwrap ( ) ;
145146
146- Arc :: new ( GCS {
147+ Arc :: new ( Gcs {
147148 client : Arc :: new ( gcs) ,
148149 bucket : self . bucket_name . clone ( ) ,
149150 root : StorePath :: from ( "" ) ,
@@ -167,13 +168,13 @@ impl ObjectStorageProvider for GCSConfig {
167168}
168169
169170#[ derive( Debug ) ]
170- pub struct GCS {
171+ pub struct Gcs {
171172 client : Arc < GoogleCloudStorage > ,
172173 bucket : String ,
173174 root : StorePath ,
174175}
175176
176- impl GCS {
177+ impl Gcs {
177178 async fn _get_object ( & self , path : & RelativePath ) -> Result < Bytes , ObjectStorageError > {
178179 let instant = Instant :: now ( ) ;
179180
@@ -215,7 +216,7 @@ impl GCS {
215216 let source_str = source. to_string ( ) ;
216217 if source_str. contains ( "<Code>NoSuchBucket</Code>" ) {
217218 return Err ( ObjectStorageError :: Custom (
218- format ! ( "Bucket '{}' does not exist in S3 ." , self . bucket) . to_string ( ) ,
219+ format ! ( "Bucket '{}' does not exist in GCS ." , self . bucket) . to_string ( ) ,
219220 ) ) ;
220221 }
221222 }
@@ -335,7 +336,7 @@ impl GCS {
335336 } else {
336337 let bytes = tokio:: fs:: read ( path) . await ?;
337338 let result = self . client . put ( & key. into ( ) , bytes. into ( ) ) . await ?;
338- info ! ( "Uploaded file to S3 : {:?}" , result) ;
339+ info ! ( "Uploaded file to GCS : {:?}" , result) ;
339340 Ok ( ( ) )
340341 } ;
341342
@@ -406,7 +407,7 @@ impl GCS {
406407}
407408
408409#[ async_trait]
409- impl ObjectStorage for GCS {
410+ impl ObjectStorage for Gcs {
410411 async fn get_buffered_reader (
411412 & self ,
412413 path : & RelativePath ,
0 commit comments