aiborodin commented on code in PR #14406:
URL: https://github.com/apache/iceberg/pull/14406#discussion_r2587876524
##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableMetadataCache.java:
##########
@@ -186,14 +202,15 @@ private Tuple2<Boolean, Exception>
refreshTable(TableIdentifier identifier) {
return EXISTS;
} catch (NoSuchTableException e) {
LOG.debug("Table doesn't exist {}", identifier, e);
- tableCache.put(identifier, new CacheItem(false, null, null, null, 1));
+ tableCache.put(identifier, new CacheItem(-1, false, null, null, null,
1));
return Tuple2.of(false, e);
}
}
private boolean needsRefresh(CacheItem cacheItem, boolean allowRefresh) {
return allowRefresh
- && (cacheItem == null || cacheItem.created + refreshMs >
System.currentTimeMillis());
+ && (cacheItem == null
+ || refreshMs < cacheRefreshClock.millis() -
cacheItem.createdTimestampMillis);
Review Comment:
The new condition `cacheRefreshClock.millis() -
cacheItem.createdTimestampMillis > refreshMs` seems more natural and easier to
read. It reads to me as "elapsed time greater than the refresh interval".
While the existing one (with the sign changed) seems less intuitive.
--
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]