@Override public int compare(SSTableReader o1, SSTableReader o2) { return o1.last.compareTo(o2.last); } });
public int compareTo(SSTableIdentityIterator o) { return key.compareTo(o.key); } }
public int compareTo(SSTableIdentityIterator o) { return key.compareTo(o.key); } }
@Override public int compare(SSTableReader o1, SSTableReader o2) { return o1.last.compareTo(o2.last); } });
public int compare(DecoratedKey o1, DecoratedKey o2) { return o1.compareTo(o2); } };
private void validate() { if (this.first.compareTo(this.last) > 0) { throw new CorruptSSTableException(new IllegalStateException(String.format("SSTable first key %s > last key %s", this.first, this.last)), getFilename()); } }
private void validate() { if (this.first.compareTo(this.last) > 0) { throw new CorruptSSTableException(new IllegalStateException(String.format("SSTable first key %s > last key %s", this.first, this.last)), getFilename()); } }
private void validate() { if (this.first.compareTo(this.last) > 0) { throw new CorruptSSTableException(new IllegalStateException(String.format("SSTable first key %s > last key %s", this.first, this.last)), getFilename()); } }
private boolean inCorrectLocation(SSTableReader sstable) { if (!cfs.getPartitioner().splitter().isPresent()) return true; int diskIndex = diskBoundaries.getDiskIndex(sstable); File diskLocation = diskBoundaries.directories.get(diskIndex).location; PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex); // the location we get from directoryIndex is based on the first key in the sstable // now we need to make sure the last key is less than the boundary as well: return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0; }
/** * Perform sanity checks on @param decoratedKey and @return the position in the data file before any data is written */ protected long beforeAppend(DecoratedKey decoratedKey) { assert decoratedKey != null : "Keys must not be null"; // empty keys ARE allowed b/c of indexed column values if (lastWrittenKey != null && lastWrittenKey.compareTo(decoratedKey) >= 0) throw new RuntimeException("Last written key " + lastWrittenKey + " >= current key " + decoratedKey + " writing into " + getFilename()); return (lastWrittenKey == null) ? 0 : dataFile.position(); }
/** * Perform sanity checks on @param decoratedKey and @return the position in the data file before any data is written */ protected long beforeAppend(DecoratedKey decoratedKey) { assert decoratedKey != null : "Keys must not be null"; // empty keys ARE allowed b/c of indexed column values if (lastWrittenKey != null && lastWrittenKey.compareTo(decoratedKey) >= 0) throw new RuntimeException("Last written key " + lastWrittenKey + " >= current key " + decoratedKey + " writing into " + getFilename()); return (lastWrittenKey == null) ? 0 : dataFile.position(); }
private boolean inCorrectLocation(SSTableReader sstable) { if (!cfs.getPartitioner().splitter().isPresent()) return true; int diskIndex = diskBoundaries.getDiskIndex(sstable); File diskLocation = diskBoundaries.directories.get(diskIndex).location; PartitionPosition diskLast = diskBoundaries.positions.get(diskIndex); // the location we get from directoryIndex is based on the first key in the sstable // now we need to make sure the last key is less than the boundary as well: return sstable.descriptor.directory.getAbsolutePath().startsWith(diskLocation.getAbsolutePath()) && sstable.last.compareTo(diskLast) <= 0; }
public int compare(Partition r1, Partition r2) { return r1.partitionKey().compareTo(r2.partitionKey()); } };
public int compare(Partition r1, Partition r2) { return r1.partitionKey().compareTo(r2.partitionKey()); } };
public int compare(DecoratedKey o1, DecoratedKey o2) { if ((right.compareTo(o1.getToken()) < 0 && right.compareTo(o2.getToken()) < 0) || (right.compareTo(o1.getToken()) > 0 && right.compareTo(o2.getToken()) > 0)) { // both tokens are on the same side of the wrap point return o1.compareTo(o2); } return o2.compareTo(o1); } };
public int compare(DecoratedKey o1, DecoratedKey o2) { if ((right.compareTo(o1.getToken()) < 0 && right.compareTo(o2.getToken()) < 0) || (right.compareTo(o1.getToken()) > 0 && right.compareTo(o2.getToken()) > 0)) { // both tokens are on the same side of the wrap point return o1.compareTo(o2); } return o2.compareTo(o1); } };
public int compare(DecoratedKey o1, DecoratedKey o2) { if ((right.compareTo(o1.getToken()) < 0 && right.compareTo(o2.getToken()) < 0) || (right.compareTo(o1.getToken()) > 0 && right.compareTo(o2.getToken()) > 0)) { // both tokens are on the same side of the wrap point return o1.compareTo(o2); } return o2.compareTo(o1); } };
public int compare(DecoratedKey o1, DecoratedKey o2) { if ((right.compareTo(o1.getToken()) < 0 && right.compareTo(o2.getToken()) < 0) || (right.compareTo(o1.getToken()) > 0 && right.compareTo(o2.getToken()) > 0)) { // both tokens are on the same side of the wrap point return o1.compareTo(o2); } return o2.compareTo(o1); } };
private Set<SSTableIndex> applyScope(Set<SSTableIndex> indexes) { return Sets.filter(indexes, index -> { SSTableReader sstable = index.getSSTable(); return range.startKey().compareTo(sstable.last) <= 0 && (range.stopKey().isMinimum() || sstable.first.compareTo(range.stopKey()) <= 0); }); } }
private Set<SSTableIndex> applyScope(Set<SSTableIndex> indexes) { return Sets.filter(indexes, index -> { SSTableReader sstable = index.getSSTable(); return range.startKey().compareTo(sstable.last) <= 0 && (range.stopKey().isMinimum() || sstable.first.compareTo(range.stopKey()) <= 0); }); } }