JeonDaehong commented on code in PR #3377:
URL: https://github.com/apache/iceberg-rust/pull/3377#discussion_r4237718100
##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -297,6 +309,24 @@ impl RestCatalogConfig {
.unwrap_or(false)
}
+ /// Builds the table cache for freshness-aware loading.
+ fn table_cache(&self) -> Result<TableCache> {
+ let parse = |key: &str, default: u64| -> Result<u64> {
+ self.props.get(key).map_or(Ok(default), |v| {
+ v.parse().map_err(|e| {
+ Error::new(ErrorKind::DataInvalid, format!("Invalid {key}:
{v}")).with_source(e)
+ })
+ })
+ };
+ Ok(TableCache::builder()
+ .max_capacity(parse(REST_CATALOG_PROP_TABLE_CACHE_MAX_ENTRIES,
100)?)
+ .time_to_live(Duration::from_millis(parse(
Review Comment:
Thanks, the upper bound is a nice catch too.
--
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]