Example usage for org.apache.cassandra.db ConsistencyLevel blockFor

List of usage examples for org.apache.cassandra.db ConsistencyLevel blockFor

Introduction

In this page you can find the example usage for org.apache.cassandra.db ConsistencyLevel blockFor.

Prototype

public int blockFor(Keyspace keyspace) 

Source Link

Usage

From source file:org.elassandra.cluster.InternalCassandraClusterService.java

License:Apache License

@Override
public ShardInfo shardInfo(String index, ConsistencyLevel cl) {
    Keyspace keyspace = Schema.instance.getKeyspaceInstance(state().metaData().index(index).keyspace());
    AbstractReplicationStrategy replicationStrategy = keyspace.getReplicationStrategy();
    int rf = replicationStrategy.getReplicationFactor();
    if (replicationStrategy instanceof NetworkTopologyStrategy)
        rf = ((NetworkTopologyStrategy) replicationStrategy)
                .getReplicationFactor(DatabaseDescriptor.getLocalDataCenter());
    return new ShardInfo(rf, cl.blockFor(keyspace));
}