anuragmantri commented on code in PR #14161:
URL: https://github.com/apache/iceberg/pull/14161#discussion_r2453321815
##########
aws/src/main/java/org/apache/iceberg/aws/s3/PrefixedS3Client.java:
##########
@@ -50,27 +50,17 @@ class PrefixedS3Client implements AutoCloseable {
this.s3FileIOProperties = new S3FileIOProperties(properties);
// Do not override s3 client if it was provided
if (s3 == null) {
- Object clientFactory = S3FileIOAwsClientFactories.initialize(properties);
- if (clientFactory instanceof S3FileIOAwsClientFactory) {
- this.s3 = ((S3FileIOAwsClientFactory) clientFactory)::s3;
- }
- if (clientFactory instanceof AwsClientFactory) {
- this.s3 = ((AwsClientFactory) clientFactory)::s3;
- }
+ AwsClientFactory factory =
S3FileIOAwsClientFactories.initialize(properties);
+ this.s3 = factory::s3;
if (s3FileIOProperties.isPreloadClientEnabled()) {
s3();
}
}
// Do not override s3Async client if it was provided
if (s3Async == null) {
- Object clientFactory = S3FileIOAwsClientFactories.initialize(properties);
- if (clientFactory instanceof S3FileIOAwsClientFactory) {
- this.s3Async = ((S3FileIOAwsClientFactory) clientFactory)::s3Async;
- }
- if (clientFactory instanceof AwsClientFactory) {
- this.s3Async = ((AwsClientFactory) clientFactory)::s3Async;
- }
Review Comment:
Not related to the main changes in the PR, but we were setting the same S3
object in two if statements. It felt like this could be cleaned up to one
statement. Am I missing something?
--
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]