Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman committed Aug 7, 2024
1 parent 2e7029e commit 0485f5f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1986,6 +1986,10 @@ public class Config extends ConfigBase {
"Max cache number of hive table name list."})
public static long max_hive_table_cache_num = 1000;

@ConfField(mutable = false, masterOnly = false, description = {"Hive表名缓存的最大数量。",
"Max cache number of hive table name list."})
public static long max_meta_object_cache_num = 1000;

@ConfField(mutable = false, masterOnly = false, description = {
"Hive分区表缓存的最大数量", "Max cache number of hive partition table"
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public final synchronized void makeSureInitialized() {
name,
OptionalLong.of(86400L),
OptionalLong.of(Config.external_cache_expire_time_minutes_after_access * 60L),
Config.max_hive_table_cache_num,
Config.max_meta_object_cache_num,
ignored -> getFilteredDatabaseNames(),
dbName -> Optional.ofNullable(
buildDbForInit(dbName, Util.genIdByName(name, dbName), logType)),
Expand Down Expand Up @@ -660,8 +660,6 @@ protected ExternalDatabase<? extends ExternalTable> buildDbForInit(String dbName
return new IcebergExternalDatabase(this, dbId, dbName);
case MAX_COMPUTE:
return new MaxComputeExternalDatabase(this, dbId, dbName);
//case HUDI:
//return new HudiExternalDatabase(this, dbId, dbName);
case LAKESOUL:
return new LakeSoulExternalDatabase(this, dbId, dbName);
case TEST:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public final synchronized void makeSureInitialized() {
name,
OptionalLong.of(86400L),
OptionalLong.of(Config.external_cache_expire_time_minutes_after_access * 60L),
Config.max_hive_table_cache_num,
Config.max_meta_object_cache_num,
ignored -> listTableNames(),
tableName -> Optional.ofNullable(
buildTableForInit(tableName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void setNewFileCache() {

CacheFactory fileCacheFactory = new CacheFactory(
OptionalLong.of(fileMetaCacheTtlSecond >= HMSExternalCatalog.FILE_META_CACHE_TTL_DISABLE_CACHE
? fileMetaCacheTtlSecond : 86400L),
? fileMetaCacheTtlSecond : 28800L),
OptionalLong.of(Config.external_cache_expire_time_minutes_after_access * 60L),
Config.max_external_file_cache_num,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public HudiCachedPartitionProcessor(long catalogId, ExecutorService executor) {
this.catalogId = catalogId;
this.executor = executor;
CacheFactory partitionCacheFactory = new CacheFactory(
OptionalLong.of(86400L),
OptionalLong.of(28800L),
OptionalLong.of(Config.external_cache_expire_time_minutes_after_access * 60),
Config.max_hive_table_cache_num,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ public class IcebergMetadataCache {

public IcebergMetadataCache(ExecutorService executor) {
CacheFactory snapshotListCacheFactory = new CacheFactory(
OptionalLong.of(86400L),
OptionalLong.of(28800L),
OptionalLong.of(Config.external_cache_expire_time_minutes_after_access * 60),
Config.max_hive_table_cache_num,
false,
null);
this.snapshotListCache = snapshotListCacheFactory.buildCache(key -> loadSnapshots(key), null, executor);

CacheFactory tableCacheFactory = new CacheFactory(
OptionalLong.of(86400L),
OptionalLong.of(28800L),
OptionalLong.of(Config.external_cache_expire_time_minutes_after_access * 60),
Config.max_hive_table_cache_num,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public MetaCache(String name,
CacheFactory namesCacheFactory = new CacheFactory(
expireAfterWriteSec,
refreshAfterWriteSec,
maxSize,
1, // names cache has one and only one entry
true,
null);
CacheFactory objCacheFactory = new CacheFactory(
Expand Down

0 comments on commit 0485f5f

Please sign in to comment.