You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "EdColeman (via GitHub)" <gi...@apache.org> on 2023/07/12 00:54:07 UTC

[GitHub] [accumulo] EdColeman opened a new pull request, #3599: Replace ConcurrentHashMap with Caffine cache for configs

EdColeman opened a new pull request, #3599:
URL: https://github.com/apache/accumulo/pull/3599

   Using a cache instead of a map to ensure that configs are eventually cleaned up on deletions. The issue was raised in PR #3588


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] keith-turner commented on a diff in pull request #3599: Replace ConcurrentHashMap with Caffine cache for configs

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #3599:
URL: https://github.com/apache/accumulo/pull/3599#discussion_r1268862748


##########
server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java:
##########
@@ -75,6 +79,12 @@ public ServerConfigurationFactory(ServerContext context, SiteConfiguration siteC
     this.siteConfig = siteConfig;
     this.systemConfig = memoize(() -> new SystemConfiguration(context,
         SystemPropKey.of(context.getInstanceID()), siteConfig));
+    tableParentConfigs =
+        Caffeine.newBuilder().expireAfterAccess(CACHE_EXPIRATION_HRS, TimeUnit.HOURS).build();

Review Comment:
   I was wondering if adding a weigher would make sense.  Looking at the [caffine docs](https://github.com/ben-manes/caffeine/wiki/Eviction#size-based) the weight is only acquired when something is added to the map.  So it would not really handle the case of configuration growing in size (like a user adds a large prop after its in the cache).  So a weigher probably does not makes sense for this case because Configuration objects have a dynamic size.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] keith-turner commented on a diff in pull request #3599: Replace ConcurrentHashMap with Caffine cache for configs

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #3599:
URL: https://github.com/apache/accumulo/pull/3599#discussion_r1268862748


##########
server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java:
##########
@@ -75,6 +79,12 @@ public ServerConfigurationFactory(ServerContext context, SiteConfiguration siteC
     this.siteConfig = siteConfig;
     this.systemConfig = memoize(() -> new SystemConfiguration(context,
         SystemPropKey.of(context.getInstanceID()), siteConfig));
+    tableParentConfigs =
+        Caffeine.newBuilder().expireAfterAccess(CACHE_EXPIRATION_HRS, TimeUnit.HOURS).build();

Review Comment:
   I was wondering if adding a weigher would make sense.  Looking at the [caffine docs](https://github.com/ben-manes/caffeine/wiki/Eviction#size-based) the weight is only acquired when something is added to the cache.  So it would not really handle the case of configuration growing in size (like a user adds a large prop after its in the cache).  So a weigher probably does not makes sense for this case because Configuration objects have a dynamic size.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [accumulo] EdColeman merged pull request #3599: Replace ConcurrentHashMap with Caffine cache for configs

Posted by "EdColeman (via GitHub)" <gi...@apache.org>.
EdColeman merged PR #3599:
URL: https://github.com/apache/accumulo/pull/3599


-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org