discivigour commented on code in PR #7402:
URL: https://github.com/apache/paimon/pull/7402#discussion_r2988762076


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/PartitionRefresher.java:
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.flink.lookup;
+
+import org.apache.paimon.data.BinaryRow;
+import org.apache.paimon.data.InternalRow;
+import org.apache.paimon.options.Options;
+import org.apache.paimon.predicate.Predicate;
+import org.apache.paimon.utils.ExecutorThreadFactory;
+import org.apache.paimon.utils.ExecutorUtils;
+import org.apache.paimon.utils.FileIOUtils;
+import org.apache.paimon.utils.Filter;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.Nullable;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import static 
org.apache.paimon.lookup.rocksdb.RocksDBOptions.LOOKUP_CACHE_ROWS;
+
+/** Manages partition refresh logic for {@link FullCacheLookupTable}. */
+public class PartitionRefresher implements Closeable {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(PartitionRefresher.class);
+
+    private final boolean partitionRefreshAsync;
+    private final String tableName;
+
+    @Nullable private ExecutorService partitionRefreshExecutor;
+    private AtomicReference<LookupTable> pendingLookupTable;
+    private AtomicReference<Exception> partitionRefreshException;
+
+    /** Current partitions being used for lookup. Updated when partition 
refresh completes. */
+    private List<BinaryRow> scanPartitions;
+
+    public PartitionRefresher(boolean partitionRefreshAsync, String tableName) 
{
+        this.partitionRefreshAsync = partitionRefreshAsync;
+        this.tableName = tableName;
+    }
+
+    /**
+     * Initialize partition refresh resources. Should be called during table 
initialization.
+     *
+     * @param initialPartitions the initial partitions to use for lookup
+     */
+    public void init(List<BinaryRow> initialPartitions) {

Review Comment:
   Makes sense.



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