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

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

Introduction

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

Prototype

public void setRowCacheKeysToSave(int rckts);

Source Link

Usage

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

License:Apache License

public void setCacheKeysToSave(int keyCacheKeysToSave, int rowCacheKeysToSave, int counterCacheKeysToSave) {
    try {//from  w  w w  .java  2s. 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);
    }
}