List of usage examples for org.apache.cassandra.db ClusteringComparator compare
public int compare(Clustering c1, Clustering c2)
From source file:com.stratio.cassandra.lucene.cache.SearchCacheEntry.java
License:Apache License
private boolean validPrefix(ClusteringComparator comparator, DataRange dataRange) { // Discard start prefix Optional<ClusteringPrefix> start = KeyMapper.startClusteringPrefix(dataRange); if (start.isPresent() && startPrefix.isPresent() && comparator.compare(startPrefix.get(), start.get()) > 0) { return false; }/*from w ww . j a v a 2 s . c o m*/ // Discard null clusterings if (start.isPresent() != currentClustering.isPresent()) { return false; } // Discard clustering if (start.isPresent() && comparator.compare(new Clustering(start.get().getRawValues()), currentClustering.get()) != 0) { return false; } // Discard stop prefix Optional<ClusteringPrefix> stop = KeyMapper.stopClusteringPrefix(dataRange); if (stop.isPresent() && stopPrefix.isPresent() && comparator.compare(stopPrefix.get(), stop.get()) != 0) { return false; } return true; }