List of usage examples for org.apache.cassandra.db ReadCommand clusteringIndexFilter
public abstract ClusteringIndexFilter clusteringIndexFilter(DecoratedKey key);
From source file:com.stratio.cassandra.lucene.IndexService.java
License:Apache License
/** * Returns the key range query represented by the specified {@link ReadCommand}. * * @param command the read command//from ww w . jav a2 s . co m * @return the key range query */ private Optional<Query> query(ReadCommand command) { if (command instanceof SinglePartitionReadCommand) { DecoratedKey key = ((SinglePartitionReadCommand) command).partitionKey(); ClusteringIndexFilter clusteringFilter = command.clusteringIndexFilter(key); return Optional.of(query(key, clusteringFilter)); } else if (command instanceof PartitionRangeReadCommand) { DataRange dataRange = ((PartitionRangeReadCommand) command).dataRange(); return query(dataRange); } else { throw new IndexException("Unsupported read command %s", command.getClass()); } }