rdblue commented on a change in pull request #3977:
URL: https://github.com/apache/iceberg/pull/3977#discussion_r794850620



##########
File path: 
flink/v1.13/flink/src/main/java/org/apache/iceberg/flink/sink/PartitionedDeltaWriter.java
##########
@@ -50,17 +55,43 @@
                          Schema schema,
                          RowType flinkSchema,
                          List<Integer> equalityFieldIds,
-                         boolean upsert) {
+                         boolean upsert,
+                         Map<String, String> properties) {
     super(spec, format, appenderFactory, fileFactory, io, targetFileSize, 
schema, flinkSchema, equalityFieldIds,
         upsert);
     this.partitionKey = new PartitionKey(spec, schema);
+    int writersCacheSize = PropertyUtil.propertyAsInt(
+        properties,
+        TableProperties.PARTITIONED_DELTA_WRITERS_CACHE_SIZE,
+        TableProperties.PARTITIONED_DELTA_WRITERS_CACHE_SIZE_DEFAULT);
+    long evictionTimeout = PropertyUtil.propertyAsLong(
+        properties,
+        TableProperties.PARTITIONED_DELTA_WRITERS_CACHE_EVICT_MS,
+        TableProperties.PARTITIONED_DELTA_WRITERS_CACHE_EVICT_MS_DEFAULT);
+    initWritersCache(writersCacheSize, evictionTimeout);
+  }
+
+  private synchronized void initWritersCache(int writersCacheSize, long 
evictionTimeout) {

Review comment:
       Why is this synchronized? Isn't this only called from the constructor?




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