jackye1995 commented on a change in pull request #4371:
URL: https://github.com/apache/iceberg/pull/4371#discussion_r832429783
##########
File path: aws/src/main/java/org/apache/iceberg/aws/AwsClientFactories.java
##########
@@ -118,6 +123,19 @@ public void initialize(Map<String, String> properties) {
ValidationException.check((s3AccessKeyId == null && s3SecretAccessKey ==
null) ||
(s3AccessKeyId != null && s3SecretAccessKey != null),
"S3 client access key ID and secret access key must be set at the
same time");
+ this.clientHttpType = PropertyUtil.propertyAsString(properties,
+ AwsProperties.CLIENT_HTTP_TYPE,
AwsProperties.CLIENT_HTTP_TYPE_DEFAULT);
+ }
+ }
+
+ static SdkHttpClient.Builder configureHttpClientBuilder(String
clientHttpType) {
+ switch (clientHttpType) {
+ case AwsProperties.CLIENT_HTTP_TYPE_DEFAULT:
+ return UrlConnectionHttpClient.builder();
+ case APACHE_HTTP_TYPE:
+ return ApacheHttpClient.builder();
+ default:
+ throw new RuntimeException("Unrecognized clientHttpType " +
clientHttpType);
Review comment:
prefer to use more specific error type, here we should use
`IllegalArgumentException`. The error message should be more customer facing,
instead of using variable name like `clientHttpType`, prefer something like
"Unrecognized HTTP client type: "
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]