Example usage for org.apache.cassandra.io.sstable.format SSTableReader getReadMeter

List of usage examples for org.apache.cassandra.io.sstable.format SSTableReader getReadMeter

Introduction

In this page you can find the example usage for org.apache.cassandra.io.sstable.format SSTableReader getReadMeter.

Prototype

public RestorableMeter getReadMeter() 

Source Link

Usage

From source file:com.jeffjirsa.cassandra.db.compaction.SizeTieredCompactionStrategy.java

License:Apache License

/**
 * Returns the reads per second per key for this sstable, or 0.0 if the sstable has no read meter
 *///from   w ww .  j  a  v  a 2  s . co m
private static double hotness(SSTableReader sstr) {
    // system tables don't have read meters, just use 0.0 for the hotness
    return sstr.getReadMeter() == null ? 0.0 : sstr.getReadMeter().twoHourRate() / sstr.estimatedKeys();
}