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: [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]

Reply via email to