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

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

Introduction

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

Prototype

public void setKeyCacheCapacityInMB(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 {// w  w  w .  j  a  v  a2 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);
    }
}

From source file:org.kit.tecs.NodeProbe.java

License:Apache License

public void setCacheCapacities(String tableName, String cfName, int keyCacheCapacity, int rowCacheCapacity) {
    try {//  w w w .j  a  va  2  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);
    } catch (MalformedObjectNameException e) {
        throw new RuntimeException(e);
    }
}