Gabriel39 commented on code in PR #70216:
URL: https://github.com/apache/doris/pull/70216#discussion_r4488883466


##########
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:
   Fixed in a2398935783. The scanner now reads the FE wire key 
`fluss.metadata.cache.ttl.sec`, outside the Fluss client configuration 
namespace. The embedded-cluster tests use the literal FE parameter key and open 
the real scanner: TTLs 0 and -1 bypass an already warm entry, and a custom 
one-second TTL expires cached metadata. All three scenarios fail with the 
preceding implementation and pass with the fix. All 103 scanner tests and 302 
connector tests, including FE parameter generation, pass. FE Checkstyle and 
clang-format 16 for all 12 affected C++ files also pass.



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