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 22:47:50 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #2878: API: allow closing resources in aws catalogs and S3FileIO

rdblue commented on a change in pull request #2878:
URL: https://github.com/apache/iceberg/pull/2878#discussion_r705761976



##########
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:
       I think this is a good idea, but minor.




-- 
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