Abyss-lord commented on code in PR #7200:
URL: https://github.com/apache/gravitino/pull/7200#discussion_r2115230835
##########
core/src/main/java/org/apache/gravitino/Configs.java:
##########
@@ -343,4 +343,48 @@ private Configs() {}
.stringConf()
.toSequence()
.createWithDefault(Collections.emptyList());
+
+ // Maximum number of entries in the cache
+ public static final ConfigEntry<Integer> CACHE_MAX_ENTRIES =
+ new ConfigBuilder("gravitino.cache.maxEntries")
+ .doc("Maximum number of entries allowed in the cache.")
+ .version(ConfigConstants.VERSION_0_10_0)
+ .intConf()
+ .checkValue(value -> value > 0,
ConfigConstants.POSITIVE_NUMBER_ERROR_MSG)
+ .createWithDefault(10_000);
+
+ // Whether to enable cache expiration
+ public static final ConfigEntry<Boolean> CACHE_EXPIRATION_ENABLED =
+ new ConfigBuilder("gravitino.cache.expiration.enabled")
+ .doc("Whether to enable cache entry expiration based on time.")
+ .version(ConfigConstants.VERSION_0_10_0)
+ .booleanConf()
+ .createWithDefault(true);
+
+ // Cache entry expiration time
+ 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).")
+ .version(ConfigConstants.VERSION_0_10_0)
+ .longConf()
+ .checkValue(value -> value > 0,
ConfigConstants.POSITIVE_NUMBER_ERROR_MSG)
+ .createWithDefault(3_600_000L);
+
+ // Whether to enable cache status logging
+ public static final ConfigEntry<Boolean> CACHE_STATUS_ENABLED =
+ new ConfigBuilder("gravitino.cache.status.enabled")
Review Comment:
@jerryshao Fix, I've updated the config key to use the 3-level format, e.g.
`gravitino.cache.enableWeigher` and `gravitino.cache.enableStats`.
--
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]