add get[Row|Key]CacheEntries to CacheServiceMBean

patch by Chris Burroughs; reviewed by jbellis for CASSANDRA-4859
This commit is contained in:
Jonathan Ellis 2012-10-30 10:22:22 -05:00
parent 5e15927fff
commit 99b245d318
3 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,5 @@
1.1.7
* add get[Row|Key]CacheEntries to CacheServiceMBean (CASSANDRA-4859)
* fix get_paged_slice to wrap to next row correctly (CASSANDRA-4816)
* fix indexing empty column values (CASSANDRA-4832)
* allow JdbcDate to compose null Date objects (CASSANDRA-4830)

View File

@ -248,11 +248,21 @@ public class CacheService implements CacheServiceMBean
return rowCache.weightedSize();
}
public long getRowCacheEntries()
{
return rowCache.size();
}
public long getKeyCacheSize()
{
return keyCache.weightedSize() * AVERAGE_KEY_CACHE_ROW_SIZE;
}
public long getKeyCacheEntries()
{
return keyCache.size();
}
public void reduceCacheSizes()
{
reduceRowCacheSize();

View File

@ -54,9 +54,11 @@ public interface CacheServiceMBean
public long getKeyCacheCapacityInBytes();
public void setKeyCacheCapacityInMB(long capacity);
public long getRowCacheSize();
public long getRowCacheSize(); // in bytes
public long getRowCacheEntries();
public long getKeyCacheSize();
public long getKeyCacheEntries();
/**
* sets each cache's maximum capacity to "reduce_cache_capacity_to" of its current size