You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/09/09 04:25:45 UTC
[GitHub] [iceberg] kbendick commented on a change in pull request #2878: API: allow closing resources in aws catalogs and S3FileIO
kbendick commented on a change in pull request #2878:
URL: https://github.com/apache/iceberg/pull/2878#discussion_r704940786
##########
File path: aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java
##########
@@ -105,4 +107,14 @@ public void initialize(Map<String, String> properties) {
this.awsClientFactory = AwsClientFactories.from(properties);
this.s3 = awsClientFactory::s3;
}
+
+ @Override
+ public void close() {
+ // handles concurrent calls to close()
+ if (isResourceClosed.compareAndSet(false, true)) {
+ if (client != null) {
+ client.close();
+ }
Review comment:
If this is checking for null (plus the compareAndSet), should it set it to null as well or is the AtomicBoolean sufficient?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org