Guosmilesmile commented on code in PR #18149:
URL: https://github.com/apache/iceberg/pull/18149#discussion_r4512725622
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/lookup/IcebergFullCachingLookupFunction.java:
##########
@@ -184,19 +249,25 @@ private void loadCache() throws IOException {
loaded.add(extractKey(row), rowSerializer.toBinaryRow(row).copy());
Review Comment:
Good point. Add it now.
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/lookup/IcebergFullCachingLookupFunction.java:
##########
@@ -152,23 +175,65 @@ public Collection<RowData> lookup(RowData keyRow) throws
IOException {
@Override
public void close() throws Exception {
+ this.closed = true;
+
try {
- tableLoader.close();
+ if (reloadTrigger != null) {
+ reloadTrigger.close();
+ }
} finally {
- if (cache != null) {
- cache.close();
+ try {
+ tableLoader.close();
+ } finally {
+ if (cache != null) {
+ cache.close();
+ }
+
+ super.close();
}
+ }
+ }
- super.close();
+ private CompletableFuture<Void> triggerReload() {
+ if (cache == null || closed) {
Review Comment:
Good point. Add it now.
--
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]