This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 9426448b8 [core] Lazy load all table paths for system database (#2196)
9426448b8 is described below

commit 9426448b83d53e5d04f811ecc939481d8d75a12f
Author: Shammon FY <[email protected]>
AuthorDate: Mon Oct 30 11:57:24 2023 +0800

    [core] Lazy load all table paths for system database (#2196)
---
 .../src/main/java/org/apache/paimon/catalog/AbstractCatalog.java     | 2 +-
 .../main/java/org/apache/paimon/table/system/SystemTableLoader.java  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java 
b/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java
index 10e8eff96..75c476cc8 100644
--- a/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java
+++ b/paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java
@@ -244,7 +244,7 @@ public abstract class AbstractCatalog implements Catalog {
             String tableName = identifier.getObjectName();
             Table table =
                     SystemTableLoader.loadGlobal(
-                            tableName, fileIO, allTablePaths(), 
catalogOptions);
+                            tableName, fileIO, this::allTablePaths, 
catalogOptions);
             if (table == null) {
                 throw new TableNotExistException(identifier);
             }
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/table/system/SystemTableLoader.java
 
b/paimon-core/src/main/java/org/apache/paimon/table/system/SystemTableLoader.java
index c31901af8..a241f51e3 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/table/system/SystemTableLoader.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/table/system/SystemTableLoader.java
@@ -26,6 +26,7 @@ import org.apache.paimon.table.Table;
 import javax.annotation.Nullable;
 
 import java.util.Map;
+import java.util.function.Supplier;
 
 import static 
org.apache.paimon.table.system.AllTableOptionsTable.ALL_TABLE_OPTIONS;
 import static org.apache.paimon.table.system.AuditLogTable.AUDIT_LOG;
@@ -73,11 +74,11 @@ public class SystemTableLoader {
     public static Table loadGlobal(
             String tableName,
             FileIO fileIO,
-            Map<String, Map<String, Path>> allTablePaths,
+            Supplier<Map<String, Map<String, Path>>> allTablePaths,
             Map<String, String> catalogOptions) {
         switch (tableName.toLowerCase()) {
             case ALL_TABLE_OPTIONS:
-                return new AllTableOptionsTable(fileIO, allTablePaths);
+                return new AllTableOptionsTable(fileIO, allTablePaths.get());
             case CATALOG_OPTIONS:
                 return new CatalogOptionsTable(catalogOptions);
             default:

Reply via email to