pvary commented on code in PR #19115:
URL: https://github.com/apache/iceberg/pull/19115#discussion_r4692170886


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/lookup/IcebergFullCachingLookupFunction.java:
##########
@@ -270,11 +290,53 @@ private synchronized void loadCache() throws IOException {
 
     LOG.info(
         "IcebergFullCachingLookupFunction loading finished, snapshot={}, 
rows={}, cost={} ms",
-        snapshot == null ? "none" : snapshotId,
+        snapshotId,
         rowCnt,
         loadTimeMs);
   }
 
+  private void loadDelta(long fromExclusive, long toInclusive) throws 
IOException {
+    InMemoryLookupCache delta = new InMemoryLookupCache();
+    long start = System.currentTimeMillis();
+    long rowCnt;
+    try (CloseableIterable<RowData> rows = reader.readDelta(fromExclusive, 
toInclusive)) {
+      rowCnt = fillCache(rows, delta);
+    }
+
+    long loadTimeMs = System.currentTimeMillis() - start;
+
+    if (closed) {
+      return;
+    }
+
+    this.cache = cache.mergedWith(delta);
+    this.currentSnapshotId = toInclusive;
+    this.cachedRecords = cachedRecords + rowCnt;
+    this.latestLoadTimeMs = loadTimeMs;
+    loadCounter.inc();

Review Comment:
   Do we want to have separate metrics for delta loads, and maybe delta errors 
and fallbacks?
   I leave it to you and @mxm to decide.



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

Reply via email to