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

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

Introduction

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

Prototype

public void setCounterCacheKeysToSave(int cckts);

Source Link

Usage

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

License:Apache License

public void setCacheKeysToSave(int keyCacheKeysToSave, int rowCacheKeysToSave, int counterCacheKeysToSave) {
    try {/*w w  w .  jav  a2 s .c  om*/
        String keyCachePath = "org.apache.cassandra.db:type=Caches";
        CacheServiceMBean cacheMBean = JMX.newMBeanProxy(mbeanServerConn, new ObjectName(keyCachePath),
                CacheServiceMBean.class);
        cacheMBean.setKeyCacheKeysToSave(keyCacheKeysToSave);
        cacheMBean.setRowCacheKeysToSave(rowCacheKeysToSave);
        cacheMBean.setCounterCacheKeysToSave(counterCacheKeysToSave);
    } catch (MalformedObjectNameException e) {
        throw new RuntimeException(e);
    }
}