/** * Compute a range of keys corresponding to a given range of token. */ public static Range<RowPosition> makeRowRange(Token left, Token right, IPartitioner partitioner) { return new Range<RowPosition>(left.maxKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner); }
/** * Compute a range of keys corresponding to a given range of token. */ public static Range<PartitionPosition> makeRowRange(Token left, Token right) { return new Range<PartitionPosition>(left.maxKeyBound(), right.maxKeyBound()); }
@SuppressWarnings("unchecked") public <R extends RingPosition<R>> R upperBound(Class<R> klass) { if (klass.equals(getClass())) return (R)this; else return (R)maxKeyBound(); }
@SuppressWarnings("unchecked") public <R extends RingPosition<R>> R upperBound(Class<R> klass) { if (klass.equals(getClass())) return (R)this; else return (R)maxKeyBound(); }
@SuppressWarnings("unchecked") public <R extends RingPosition<R>> R upperBound(Class<R> klass) { if (klass.equals(getClass())) return (R)this; else return (R)maxKeyBound(); }
/** * Compute a range of keys corresponding to a given range of token. */ public static Range<PartitionPosition> makeRowRange(Token left, Token right) { return new Range<PartitionPosition>(left.maxKeyBound(), right.maxKeyBound()); }
/** * Compute a range of keys corresponding to a given range of token. */ public static Range<PartitionPosition> makeRowRange(Token left, Token right) { return new Range<PartitionPosition>(left.maxKeyBound(), right.maxKeyBound()); }
@SuppressWarnings("unchecked") public <R extends RingPosition<R>> R upperBound(Class<R> klass) { if (klass.equals(getClass())) return (R)this; else return (R)maxKeyBound(); }
/** * Compute a range of keys corresponding to a given range of token. */ public static Range<PartitionPosition> makeRowRange(Token left, Token right) { return new Range<PartitionPosition>(left.maxKeyBound(), right.maxKeyBound()); }
public KeyBound maxKeyBound() { return maxKeyBound(StorageService.getPartitioner()); }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ public static Bounds<PartitionPosition> makeRowBounds(Token left, Token right) { return new Bounds<PartitionPosition>(left.minKeyBound(), right.maxKeyBound()); }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ public static Bounds<PartitionPosition> makeRowBounds(Token left, Token right) { return new Bounds<PartitionPosition>(left.minKeyBound(), right.maxKeyBound()); }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ public static Bounds<PartitionPosition> makeRowBounds(Token left, Token right) { return new Bounds<PartitionPosition>(left.minKeyBound(), right.maxKeyBound()); }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ public static Bounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner) { return new Bounds<RowPosition>(left.minKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner); }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ private static ExcludingBounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner) { return new ExcludingBounds<RowPosition>(left.maxKeyBound(partitioner), right.minKeyBound(partitioner), partitioner); }
/** * Compute a bounds of keys corresponding to a given bounds of token. */ private static IncludingExcludingBounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner) { return new IncludingExcludingBounds<RowPosition>(left.maxKeyBound(partitioner), right.minKeyBound(partitioner), partitioner); }
private static Collection<SSTableReader> sstablesInBounds(ColumnFamilyStore cfs, Collection<Range<Token>> tokenRangeCollection) { final Set<SSTableReader> sstables = new HashSet<>(); Iterable<SSTableReader> liveTables = cfs.getTracker().getView().select(SSTableSet.LIVE); SSTableIntervalTree tree = SSTableIntervalTree.build(liveTables); for (Range<Token> tokenRange : tokenRangeCollection) { Iterable<SSTableReader> ssTableReaders = View.sstablesInBounds(tokenRange.left.minKeyBound(), tokenRange.right.maxKeyBound(), tree); Iterables.addAll(sstables, ssTableReaders); } return sstables; }
private static Collection<SSTableReader> sstablesInBounds(ColumnFamilyStore cfs, Collection<Range<Token>> tokenRangeCollection) { final Set<SSTableReader> sstables = new HashSet<>(); Iterable<SSTableReader> liveTables = cfs.getTracker().getView().select(SSTableSet.LIVE); SSTableIntervalTree tree = SSTableIntervalTree.build(liveTables); for (Range<Token> tokenRange : tokenRangeCollection) { Iterable<SSTableReader> ssTableReaders = View.sstablesInBounds(tokenRange.left.minKeyBound(), tokenRange.right.maxKeyBound(), tree); Iterables.addAll(sstables, ssTableReaders); } return sstables; }
private static Collection<SSTableReader> sstablesInBounds(ColumnFamilyStore cfs, Collection<Range<Token>> tokenRangeCollection) { final Set<SSTableReader> sstables = new HashSet<>(); Iterable<SSTableReader> liveTables = cfs.getTracker().getView().select(SSTableSet.LIVE); SSTableIntervalTree tree = SSTableIntervalTree.build(liveTables); for (Range<Token> tokenRange : tokenRangeCollection) { Iterable<SSTableReader> ssTableReaders = View.sstablesInBounds(tokenRange.left.minKeyBound(), tokenRange.right.maxKeyBound(), tree); Iterables.addAll(sstables, ssTableReaders); } return sstables; }
/** * @param schemaCfName The name of the ColumnFamily responsible for part of the schema (keyspace, ColumnFamily, columns) * @return low-level schema representation (each row represents individual Keyspace or ColumnFamily) */ public static List<Row> serializedSchema(String schemaCfName) { Token minToken = StorageService.getPartitioner().getMinimumToken(); return schemaCFS(schemaCfName).getRangeSlice(new Range<RowPosition>(minToken.minKeyBound(), minToken.maxKeyBound()), null, new IdentityQueryFilter(), Integer.MAX_VALUE, System.currentTimeMillis()); }