nastra commented on code in PR #8315:
URL: https://github.com/apache/iceberg/pull/8315#discussion_r1294288109
##########
aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java:
##########
@@ -619,4 +635,21 @@ public void setConf(Configuration conf) {
protected Map<String, String> properties() {
return catalogProperties == null ? ImmutableMap.of() : catalogProperties;
}
+
+ private Cache<TableOperations, FileIO> newFileIOCloser() {
+ return Caffeine.newBuilder()
+ .weakKeys()
+ .removalListener(
+ (RemovalListener<TableOperations, FileIO>)
+ (ops, fileIO, cause) -> {
+ if (null != fileIO) {
+ fileIO.close();
+ }
+ })
+ .build();
+ }
+
+ private void trackFileIO(GlueTableOperations ops) {
Review Comment:
both places can just call `fileIOCloser.put(ops, ops.io());` rather than
introducing this method. In `RESTSessionCatalog#trackFileIO(..)` the situation
is slightly different, because `trackFileIO()` does some additional checking,
which isn't necessary here, meaning that we don't need this method
--
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]