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

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

Introduction

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

Prototype

public void setKeyCacheKeysToSave(int kckts);

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  . j a  va2  s.  c  o m
        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);
    }
}