dejii commented on code in PR #38149:
URL: https://github.com/apache/beam/pull/38149#discussion_r3075180132
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/WriteDirectRowsToFiles.java:
##########
@@ -137,5 +139,12 @@ public void finishBundle(FinishBundleContext context)
throws Exception {
}
recordWriterManager = null;
}
+
+ @Teardown
+ public void teardown() throws IOException {
+ if (catalog instanceof Closeable) {
+ ((Closeable) catalog).close();
Review Comment:
Since we've established that the catalog is not shared, then I'm not sure
this applies.
I'll also add that both `S3FileIO` and `GCSFileIO` for example explicitly
handle concurrent close calls via `AtomicBoolean.compareAndSet`, with both
having the comment "handles concurrent calls to close()" in their source
([S3FileIO.java#L539](https://github.com/apache/iceberg/blob/56092bc8cbfa19380cdd4513fc707c6d97ef8e36/aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java#L539),
[GCSFileIO.java#L278](https://github.com/apache/iceberg/blob/56092bc8cbfa19380cdd4513fc707c6d97ef8e36/gcp/src/main/java/org/apache/iceberg/gcp/gcs/GCSFileIO.java#L278)).
--
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]