github-actions[bot] commented on code in PR #70216:
URL: https://github.com/apache/doris/pull/70216#discussion_r4488776630


##########
fe/be-java-extensions/fluss-scanner/src/main/java/org/apache/doris/fluss/FlussTableInfoCache.java:
##########
@@ -0,0 +1,125 @@
+// 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.doris.fluss;
+
+import org.apache.fluss.metadata.TableInfo;
+import org.apache.fluss.metadata.TablePath;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.LongSupplier;
+import java.util.function.Supplier;
+
+/**
+ * Table infos kept for a short time from one scan range to the next, for 
every range this BE reads.
+ *
+ * <p>{@code Connection#getTable} refreshes the table's metadata and asks for 
its info, and a fluss server
+ * answers both from ZooKeeper. A point lookup is one range, so under 
concurrent lookups those two requests
+ * per query queued on the tablet server in front of the lookups themselves. A 
range now builds its table
+ * from an info another range loaded within the TTL, and leaves the bucket 
metadata to the fluss reader,
+ * which fetches what its connection is missing and refreshes what a server 
rejects.
+ *
+ * <p>A dropped, recreated or altered table is seen once its entry expires; a 
range that needs a column its
+ * entry lacks reloads it at once ({@link #reload}). Keyed by the whole client 
configuration, like
+ * {@link FlussConnectionPool}, so catalogs on different clusters never share 
an entry; the key can hold
+ * credentials and is never logged.
+ */
+final class FlussTableInfoCache {
+
+    /** The catalog's {@code fluss.metadata.cache.ttl.sec}, which FE keeps its 
table infos for as well. */
+    static final String TTL_PROPERTY = "fluss.client.metadata.cache.ttl.sec";

Review Comment:
   [P2] Read the metadata TTL key emitted by FE
   
   FE now sends the validated catalog setting as 
`fluss.metadata.cache.ttl.sec`, and `FlussJniReader::build_scanner_params()` 
copies it verbatim, but `openTable()` looks up this 
`fluss.client.metadata.cache.ttl.sec` constant. Consequently a real catalog 
configured with TTL `0` or `-1` still uses the ten-second process-wide cache, 
and every custom positive TTL is ignored. Align this key with FE and cover 
scanner opening with the actual FE-produced parameter map; the current scanner 
tests inject this constant directly and miss the mismatch.



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