You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "Mmuzaf (via GitHub)" <gi...@apache.org> on 2024/10/30 16:57:04 UTC

Re: [PR] CASSANDRA-19429 4.1 remove capacity calls when unnecessary [cassandra]

Mmuzaf commented on code in PR #3133:
URL: https://github.com/apache/cassandra/pull/3133#discussion_r1823045462


##########
src/java/org/apache/cassandra/db/ColumnFamilyStore.java:
##########
@@ -3048,19 +3049,19 @@ public boolean isEmpty()
     public boolean isRowCacheEnabled()
     {
 
-        boolean retval = metadata().params.caching.cacheRows() && CacheService.instance.rowCache.getCapacity() > 0;
+        boolean retval = metadata().params.caching.cacheRows() && DatabaseDescriptor.getRowCacheSizeInMiB() > 0;

Review Comment:
   `DatabaseDescriptor.getRowCacheSizeInMiB() > 0` -- this condition is unclear to the user/developer facing it for the first time, so my suggestion is to create a new method in the `DatabaseDescriptor` class and reuse it where we need it. I've looked at the latest branch (trunk) and I think we could push a new method there as well.
   
   An example:
   ```
       public static boolean isRowCacheEnabled()
       {
           return conf.row_cache_size.toMebibytes() > 0;
       }
   ```
   
   Similar methods should be created for the counter and key caches. 
   



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org