dejii commented on code in PR #38149:
URL: https://github.com/apache/beam/pull/38149#discussion_r3075466758
##########
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:
Can a `DoFn` instance be reused after `@Teardown` is called? My
understanding, per the Beam contract
[DoFn.java#L940-L941](https://github.com/apache/beam/blob/80c4c7a8dd05c0f219e2ff9531244280960ee2a1/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java#L940-L941),
is that such transition is not valid but I'm happy to be corrected if that's
not the case.
--
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]