Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#7464] improvement(conf): Update conf template with cache configuration settings. (#7470)

Lord of Abyssf84361e78f7c
diff --git a/conf/gravitino.conf.template b/conf/gravitino.conf.template
index 9b1c2512cf..418d14f14c 100644
--- a/conf/gravitino.conf.template
+++ b/conf/gravitino.conf.template
@@ -59,6 +59,21 @@ gravitino.entity.store.relational.jdbcPassword = gravitino
# The interval in milliseconds to evict the catalog cache
gravitino.catalog.cache.evictionIntervalMs = 3600000
+# THE CONFIGURATION FOR Gravitino Entity Cache
+# Whether to enable the cached Entity store.
+gravitino.cache.enabled = true
+# Maximum number of entries allowed in the cache (effective only when weighted eviction is disabled).
+gravitino.cache.maxEntries = 10000
+# Time-to-live (TTL) for each cache entry after it is written, in milliseconds.
+gravitino.cache.expireTimeInMs = 3600000
+# Whether to enable cache statistics logging (e.g., hit/miss count, load failures, current size).
+gravitino.cache.enableStats = false
+# Whether to enable weighted cache eviction.
+# If enabled, cache entries are evicted based on their weight rather than count.
+gravitino.cache.enableWeigher = true
+# The cache implementation to use (e.g., caffeine).
+gravitino.cache.implementation = caffeine
+
# THE CONFIGURATION FOR authorization
# Whether Gravitino enable authorization or not
gravitino.authorization.enable = false
diff --git a/core/src/main/java/org/apache/gravitino/Configs.java b/core/src/main/java/org/apache/gravitino/Configs.java
index 76f5235f6f..dd06a0496c 100644
--- a/core/src/main/java/org/apache/gravitino/Configs.java
+++ b/core/src/main/java/org/apache/gravitino/Configs.java
@@ -347,7 +347,7 @@ public class Configs {
// Whether to enable cache store
public static final ConfigEntry<Boolean> CACHE_ENABLED =
new ConfigBuilder("gravitino.cache.enabled")
- .doc("Whether to enable cache store.")
+ .doc("Whether to enable the cached Entity store.")
.version(ConfigConstants.VERSION_1_0_0)
.booleanConf()
.createWithDefault(true);
@@ -365,7 +365,8 @@ public class Configs {
public static final ConfigEntry<Long> CACHE_EXPIRATION_TIME =
new ConfigBuilder("gravitino.cache.expireTimeInMs")
.doc(
- "Time in milliseconds after which a cache entry expires. Default is 3,600,000 ms (1 hour).")
+ "Time-to-live (TTL) for each cache entry after it is written, in milliseconds."
+ + "Default is 3,600,000 ms (1 hour).")
.version(ConfigConstants.VERSION_1_0_0)
.longConf()
.checkValue(value -> value >= 0, ConfigConstants.POSITIVE_NUMBER_ERROR_MSG)