@@ -103,39 +103,35 @@ public class S3IcebergFileIOProvider extends AbstractControllerService implement
103103 )
104104 .build ();
105105
106- static final PropertyDescriptor ENDPOINT = new PropertyDescriptor .Builder ()
107- .name ("Endpoint" )
108- .description ("Endpoint Override URL, use for on-premise s3 compactible solutions" )
106+ static final PropertyDescriptor ENDPOINT_URL = new PropertyDescriptor .Builder ()
107+ .name ("Endpoint URL" )
108+ .description ("""
109+ Endpoint URL to use instead of the AWS default including scheme, host, port, and path.
110+ The AWS libraries select an endpoint URL based on the AWS region, but this property overrides
111+ the selected endpoint URL, allowing use with other S3-compatible endpoints.""" )
109112 .required (false )
110- .addValidator (StandardValidators .URI_VALIDATOR )
111- .dependsOn (
112- AUTHENTICATION_STRATEGY ,
113- AuthenticationStrategy .BASIC_CREDENTIALS
114- )
113+ .addValidator (StandardValidators .URL_VALIDATOR )
115114 .build ();
116115
117- static final PropertyDescriptor PATH_STYLE_ACCESS = new PropertyDescriptor .Builder ()
116+ static final PropertyDescriptor PATH_STYLE_ACCESS = new PropertyDescriptor .Builder ()
118117 .name ("Path Style Access" )
119- .description ("Path Style Access, use for on-premise s3 compactible solutions" )
118+ .description ("""
119+ Path-style access can be enforced by setting this property to true. Set it to true if the configured
120+ endpoint does not support virtual-hosted-style requests, only path-style requests.""" )
121+ .allowableValues (Boolean .TRUE .toString (), Boolean .FALSE .toString ())
122+ .defaultValue (String .valueOf (S3FileIOProperties .PATH_STYLE_ACCESS_DEFAULT ))
120123 .required (true )
121124 .addValidator (StandardValidators .BOOLEAN_VALIDATOR )
122- .allowableValues ("true" , "false" )
123- .defaultValue (String .valueOf (S3FileIOProperties .PATH_STYLE_ACCESS_DEFAULT ))
124- .dependsOn (
125- AUTHENTICATION_STRATEGY ,
126- AuthenticationStrategy .BASIC_CREDENTIALS
127- )
128125 .build ();
129126
130127 static final PropertyDescriptor STORAGE_CLASS = new PropertyDescriptor .Builder ()
131128 .name ("Storage Class" )
132- .description ("Storage Class, use for on-premise s3 compactible solutions" )
133- .required (false )
129+ .description ("""
130+ Specifies the S3 storage class to use when writing objects.
131+ Primarily intended for on-premises or S3-compatible object storage implementations.""" )
132+ .required (true )
134133 .allowableValues (StorageClass .values ())
135- .dependsOn (
136- AUTHENTICATION_STRATEGY ,
137- AuthenticationStrategy .BASIC_CREDENTIALS
138- )
134+ .defaultValue (String .valueOf (StorageClass .STANDARD ))
139135 .build ();
140136
141137 private static final List <PropertyDescriptor > PROPERTY_DESCRIPTORS = List .of (
@@ -144,7 +140,7 @@ public class S3IcebergFileIOProvider extends AbstractControllerService implement
144140 SECRET_ACCESS_KEY ,
145141 SESSION_TOKEN ,
146142 CLIENT_REGION ,
147- ENDPOINT ,
143+ ENDPOINT_URL ,
148144 PATH_STYLE_ACCESS ,
149145 STORAGE_CLASS
150146 );
@@ -189,22 +185,24 @@ private Map<String, String> getConfiguredProperties(final ConfigurationContext c
189185
190186 final String accessKeyId = context .getProperty (ACCESS_KEY_ID ).getValue ();
191187 final String secretAccessKey = context .getProperty (SECRET_ACCESS_KEY ).getValue ();
192- final String endpoint = context .getProperty (ENDPOINT ).getValue ();
193- final String pathStyleAccess = context .getProperty (PATH_STYLE_ACCESS ).getValue ();
194- final String storageCLass = context .getProperty (STORAGE_CLASS ).getValue ();
195-
196188 contextProperties .put (S3FileIOProperties .ACCESS_KEY_ID , accessKeyId );
197189 contextProperties .put (S3FileIOProperties .SECRET_ACCESS_KEY , secretAccessKey );
198- contextProperties .put (S3FileIOProperties .ENDPOINT , endpoint );
199- contextProperties .put (S3FileIOProperties .PATH_STYLE_ACCESS , pathStyleAccess );
200- contextProperties .put (S3FileIOProperties .WRITE_STORAGE_CLASS , storageCLass );
201190
202191 if (AuthenticationStrategy .SESSION_CREDENTIALS == authenticationStrategy ) {
203192 final String sessionToken = context .getProperty (SESSION_TOKEN ).getValue ();
204193 contextProperties .put (S3FileIOProperties .SESSION_TOKEN , sessionToken );
205194 }
206195 }
207196
197+ if (context .getProperty (ENDPOINT_URL ).isSet ()) {
198+ final String endpoint = context .getProperty (ENDPOINT_URL ).getValue ();
199+ contextProperties .put (S3FileIOProperties .ENDPOINT , endpoint );
200+ }
201+ final String pathStyleAccess = context .getProperty (PATH_STYLE_ACCESS ).getValue ();
202+ contextProperties .put (S3FileIOProperties .PATH_STYLE_ACCESS , pathStyleAccess );
203+
204+ final String storageClass = context .getProperty (STORAGE_CLASS ).getValue ();
205+ contextProperties .put (S3FileIOProperties .WRITE_STORAGE_CLASS , storageClass );
208206 // HttpURLConnection Client Type avoids additional dependencies
209207 contextProperties .put (HttpClientProperties .CLIENT_TYPE , HttpClientProperties .CLIENT_TYPE_URLCONNECTION );
210208
@@ -214,4 +212,4 @@ private Map<String, String> getConfiguredProperties(final ConfigurationContext c
214212 final S3FileIOProperties ioProperties = new S3FileIOProperties (contextProperties );
215213 return ioProperties .properties ();
216214 }
217- }
215+ }
0 commit comments