Example usage for org.apache.cassandra.db ColumnFamilyStoreMBean finishLocalSampling

List of usage examples for org.apache.cassandra.db ColumnFamilyStoreMBean finishLocalSampling

Introduction

In this page you can find the example usage for org.apache.cassandra.db ColumnFamilyStoreMBean finishLocalSampling.

Prototype

public List<CompositeData> finishLocalSampling(String sampler, int count) throws OpenDataException;

Source Link

Usage

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

License:Apache License

public Map<Sampler, CompositeData> getPartitionSample(String ks, String cf, int capacity, int duration,
        int count, List<Sampler> samplers) throws OpenDataException {
    ColumnFamilyStoreMBean cfsProxy = getCfsProxy(ks, cf);
    for (Sampler sampler : samplers) {
        cfsProxy.beginLocalSampling(sampler.name(), capacity);
    }/*www. j a va2s.  c  o  m*/
    Uninterruptibles.sleepUninterruptibly(duration, TimeUnit.MILLISECONDS);
    Map<Sampler, CompositeData> result = Maps.newHashMap();
    for (Sampler sampler : samplers) {
        result.put(sampler, cfsProxy.finishLocalSampling(sampler.name(), count));
    }
    return result;
}