eric-maynard commented on code in PR #1356:
URL: https://github.com/apache/polaris/pull/1356#discussion_r2042577728
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/EntityCache.java:
##########
@@ -53,16 +52,22 @@ public class EntityCache {
// index by name
private final AbstractMap<EntityCacheByNameKey, ResolvedPolarisEntity>
byName;
+ private final PolarisCallContext polarisCallContext;
+
/**
* Constructor. Cache can be private or shared
*
* @param polarisMetaStoreManager the meta store manager implementation
*/
- public EntityCache(@Nonnull PolarisMetaStoreManager polarisMetaStoreManager)
{
+ public EntityCache(
+ @Nonnull PolarisMetaStoreManager polarisMetaStoreManager,
+ @Nonnull PolarisCallContext polarisCallContext) {
// by name cache
this.byName = new ConcurrentHashMap<>();
+ this.polarisCallContext = polarisCallContext;
Review Comment:
This particular case is worth discussing more. For things like the
EntityCache, it may be the case that there are things you can configure in the
application.properties which are fundamentally invalid to set at "request
time". They may have to do with how Polaris starts up, or they may affect a
singleton(-ish) object like the EntityCache.
Currently we still just use the config via the `PolarisCallContext` with the
acknowledgement that it's only really used once and then ignored in future
requests. Is there a better pattern we can use here for accessing configs?
--
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]