gemini-code-assist[bot] commented on code in PR #37102:
URL: https://github.com/apache/beam/pull/37102#discussion_r2615872744


##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/RecordWriterManager.java:
##########
@@ -256,8 +259,40 @@ static String getPartitionDataPath(
   private final Map<WindowedValue<IcebergDestination>, 
List<SerializableDataFile>>
       totalSerializableDataFiles = Maps.newHashMap();
 
+  static final class LastRefreshedTable {
+    final Table table;
+    volatile Instant lastRefreshTime;
+    static final Duration STALENESS_THRESHOLD = Duration.ofMinutes(3);
+
+    LastRefreshedTable(Table table, Instant lastRefreshTime) {
+      this.table = table;
+      this.lastRefreshTime = lastRefreshTime;
+    }
+
+    /**
+     * Refreshes the table metadata if it is considered stale (older than 3 
minutes).

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The staleness threshold is set to 3 minutes, but the pull request 
description mentions 2 minutes: "After this PR we will only reload the Iceberg 
Table metadata every 2 minutes per-worker." To ensure consistency between the 
code, its documentation, and the PR description, I recommend changing this to 2 
minutes.
   
   ```suggestion
       static final Duration STALENESS_THRESHOLD = Duration.ofMinutes(2);
   
       LastRefreshedTable(Table table, Instant lastRefreshTime) {
         this.table = table;
         this.lastRefreshTime = lastRefreshTime;
       }
   
       /**
        * Refreshes the table metadata if it is considered stale (older than 2 
minutes).
   ```



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

Reply via email to