Search in sources :

Example 6 with PartitionRangeReadCommand

use of org.apache.cassandra.db.PartitionRangeReadCommand in project cassandra by apache.

the class RangeCommandsTest method testEstimateResultsPerRange.

private static void testEstimateResultsPerRange(Keyspace keyspace, ColumnFamilyStore cfs, int rf, int commandEstimate, Integer indexEstimate, float expectedEstimate) {
    PartitionRangeReadCommand command = command(cfs, Integer.MAX_VALUE, commandEstimate, indexEstimate);
    assertEquals(expectedEstimate / rf, RangeCommands.estimateResultsPerRange(command, keyspace), 0);
}
Also used : PartitionRangeReadCommand(org.apache.cassandra.db.PartitionRangeReadCommand)

Aggregations

PartitionRangeReadCommand (org.apache.cassandra.db.PartitionRangeReadCommand)6 ColumnFamilyStore (org.apache.cassandra.db.ColumnFamilyStore)2 Keyspace (org.apache.cassandra.db.Keyspace)2 PartitionPosition (org.apache.cassandra.db.PartitionPosition)2 ReplicaPlan (org.apache.cassandra.locator.ReplicaPlan)2 Test (org.junit.Test)2 AbstractReadCommandBuilder (org.apache.cassandra.db.AbstractReadCommandBuilder)1 DataRange (org.apache.cassandra.db.DataRange)1 ReadCommand (org.apache.cassandra.db.ReadCommand)1 RowUpdateBuilder (org.apache.cassandra.db.RowUpdateBuilder)1 DataLimits (org.apache.cassandra.db.filter.DataLimits)1 Token (org.apache.cassandra.dht.Token)1 EndpointsForRange (org.apache.cassandra.locator.EndpointsForRange)1 Replica (org.apache.cassandra.locator.Replica)1 StorageProxy (org.apache.cassandra.service.StorageProxy)1 DataResolver (org.apache.cassandra.service.reads.DataResolver)1 ReadCallback (org.apache.cassandra.service.reads.ReadCallback)1