jrmccluskey commented on code in PR #40140:
URL: https://github.com/apache/beam/pull/40140#discussion_r4038074503


##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergIO.java:
##########
@@ -524,6 +543,87 @@ public WriteRows withSortOrder(List<String> sortFields) {
       return toBuilder().setSortFields(sortFields).build();
     }
 
+    /**
+     * Enables expirable side-input caching of Iceberg table metadata across 
workers.
+     *
+     * <p>When enabled, a driver transform periodically polls the Iceberg 
catalog and broadcasts
+     * lightweight table specifications as a side input. Workers construct 
in-memory {@link Table}
+     * representations without issuing remote catalog RPCs, drastically 
reducing catalog load.
+     */
+    public WriteRows withSideInputTableCache() {
+      return toBuilder().setUsingSideInputTableCache(true).build();
+    }
+
+    /**
+     * Configures whether to enable expirable side-input caching of Iceberg 
table metadata across
+     * workers.
+     *
+     * @param enabled true to enable side-input table caching; false to 
disable it
+     */
+    public WriteRows withSideInputTableCache(boolean enabled) {
+      return toBuilder().setUsingSideInputTableCache(enabled).build();
+    }
+
+    /**
+     * Sets the maximum number of distinct table metadata specifications to 
broadcast in the
+     * side-input cache. Any tables exceeding this limit fall back to 
worker-local catalog loading.
+     *
+     * <p><b>Note:</b> This option is only supported for bounded (batch) 
pipelines. Calling this on
+     * an unbounded streaming pipeline will throw an exception at pipeline 
execution.
+     */
+    public WriteRows withMaximumCacheSize(int maximumCacheSize) {
+      Preconditions.checkArgument(maximumCacheSize > 0, "maximumCacheSize must 
be greater than 0");
+      return toBuilder()
+          .setUsingSideInputTableCache(true)

Review Comment:
   removed



##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergIO.java:
##########
@@ -524,6 +543,87 @@ public WriteRows withSortOrder(List<String> sortFields) {
       return toBuilder().setSortFields(sortFields).build();
     }
 
+    /**
+     * Enables expirable side-input caching of Iceberg table metadata across 
workers.
+     *
+     * <p>When enabled, a driver transform periodically polls the Iceberg 
catalog and broadcasts
+     * lightweight table specifications as a side input. Workers construct 
in-memory {@link Table}
+     * representations without issuing remote catalog RPCs, drastically 
reducing catalog load.
+     */
+    public WriteRows withSideInputTableCache() {
+      return toBuilder().setUsingSideInputTableCache(true).build();
+    }
+
+    /**
+     * Configures whether to enable expirable side-input caching of Iceberg 
table metadata across
+     * workers.
+     *
+     * @param enabled true to enable side-input table caching; false to 
disable it
+     */
+    public WriteRows withSideInputTableCache(boolean enabled) {
+      return toBuilder().setUsingSideInputTableCache(enabled).build();
+    }

Review Comment:
   simplified



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