Example usage for org.apache.cassandra.service CacheServiceMBean setCounterCacheCapacityInMB

List of usage examples for org.apache.cassandra.service CacheServiceMBean setCounterCacheCapacityInMB

Introduction

In this page you can find the example usage for org.apache.cassandra.service CacheServiceMBean setCounterCacheCapacityInMB.

Prototype

public void setCounterCacheCapacityInMB(long capacity);

Source Link

Usage

From source file:com.wenyu.utils.ClusterToolNodeProbe.java

License:Apache License

public void setCacheCapacities(int keyCacheCapacity, int rowCacheCapacity, int counterCacheCapacity) {
    try {//from  w  w  w. j  a  va2  s.c  om
        String keyCachePath = "org.apache.cassandra.db:type=Caches";
        CacheServiceMBean cacheMBean = JMX.newMBeanProxy(mbeanServerConn, new ObjectName(keyCachePath),
                CacheServiceMBean.class);
        cacheMBean.setKeyCacheCapacityInMB(keyCacheCapacity);
        cacheMBean.setRowCacheCapacityInMB(rowCacheCapacity);
        cacheMBean.setCounterCacheCapacityInMB(counterCacheCapacity);
    } catch (MalformedObjectNameException e) {
        throw new RuntimeException(e);
    }
}