public ClusteringIndexNamesFilter forPaging(ClusteringComparator comparator, Clustering lastReturned, boolean inclusive) { NavigableSet<Clustering> newClusterings = reversed ? clusterings.headSet(lastReturned, inclusive) : clusterings.tailSet(lastReturned, inclusive); return new ClusteringIndexNamesFilter(newClusterings, reversed); }
public ClusteringIndexNamesFilter forPaging(ClusteringComparator comparator, Clustering lastReturned, boolean inclusive) { NavigableSet<Clustering> newClusterings = reversed ? clusterings.headSet(lastReturned, inclusive) : clusterings.tailSet(lastReturned, inclusive); return new ClusteringIndexNamesFilter(newClusterings, reversed); }
public ClusteringIndexNamesFilter forPaging(ClusteringComparator comparator, Clustering lastReturned, boolean inclusive) { NavigableSet<Clustering> newClusterings = reversed ? clusterings.headSet(lastReturned, inclusive) : clusterings.tailSet(lastReturned, inclusive); return new ClusteringIndexNamesFilter(newClusterings, reversed); }
public ClusteringIndexNamesFilter forPaging(ClusteringComparator comparator, Clustering lastReturned, boolean inclusive) { NavigableSet<Clustering> newClusterings = reversed ? clusterings.headSet(lastReturned, inclusive) : clusterings.tailSet(lastReturned, inclusive); return new ClusteringIndexNamesFilter(newClusterings, reversed); }
protected ClusteringIndexFilter makeFilter() { // StatementRestrictions.isColumnRange() returns false for static compact tables, which means // SelectStatement.makeClusteringIndexFilter uses a names filter with no clusterings for static // compact tables, here we reproduce this behavior (CASSANDRA-11223). Note that this code is only // called by tests. if (cfs.metadata.isStaticCompactTable()) return new ClusteringIndexNamesFilter(new TreeSet<>(cfs.metadata.comparator), reversed); if (clusterings != null) { return new ClusteringIndexNamesFilter(clusterings, reversed); } else { Slice slice = Slice.make(lowerClusteringBound == null ? ClusteringBound.BOTTOM : lowerClusteringBound, upperClusteringBound == null ? ClusteringBound.TOP : upperClusteringBound); return new ClusteringIndexSliceFilter(Slices.with(cfs.metadata.comparator, slice), reversed); } }
protected ClusteringIndexFilter makeFilter() { // StatementRestrictions.isColumnRange() returns false for static compact tables, which means // SelectStatement.makeClusteringIndexFilter uses a names filter with no clusterings for static // compact tables, here we reproduce this behavior (CASSANDRA-11223). Note that this code is only // called by tests. if (cfs.metadata.isStaticCompactTable()) return new ClusteringIndexNamesFilter(new TreeSet<>(cfs.metadata.comparator), reversed); if (clusterings != null) { return new ClusteringIndexNamesFilter(clusterings, reversed); } else { Slice slice = Slice.make(lowerClusteringBound == null ? ClusteringBound.BOTTOM : lowerClusteringBound, upperClusteringBound == null ? ClusteringBound.TOP : upperClusteringBound); return new ClusteringIndexSliceFilter(Slices.with(cfs.metadata.comparator, slice), reversed); } }
protected ClusteringIndexFilter makeFilter() { // StatementRestrictions.isColumnRange() returns false for static compact tables, which means // SelectStatement.makeClusteringIndexFilter uses a names filter with no clusterings for static // compact tables, here we reproduce this behavior (CASSANDRA-11223). Note that this code is only // called by tests. if (cfs.metadata.isStaticCompactTable()) return new ClusteringIndexNamesFilter(new TreeSet<>(cfs.metadata.comparator), reversed); if (clusterings != null) { return new ClusteringIndexNamesFilter(clusterings, reversed); } else { Slice slice = Slice.make(lowerClusteringBound == null ? ClusteringBound.BOTTOM : lowerClusteringBound, upperClusteringBound == null ? ClusteringBound.TOP : upperClusteringBound); return new ClusteringIndexSliceFilter(Slices.with(cfs.metadata.comparator, slice), reversed); } }
/** * Creates a new single partition name command for the provided rows. * * @param metadata the table to query. * @param nowInSec the time in seconds to use are "now" for this query. * @param key the partition key for the partition to query. * @param names the clustering for the rows to query. * * @return a newly created read command that queries the {@code names} in {@code key}. The returned query will * query every columns (without limit or row filtering) and be in forward order. */ public static SinglePartitionReadCommand create(CFMetaData metadata, int nowInSec, DecoratedKey key, NavigableSet<Clustering> names) { ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(names, false); return create(metadata, nowInSec, ColumnFilter.all(metadata), RowFilter.NONE, DataLimits.NONE, key, filter); }
/** * Creates a new single partition name command for the provided rows. * * @param metadata the table to query. * @param nowInSec the time in seconds to use are "now" for this query. * @param key the partition key for the partition to query. * @param names the clustering for the rows to query. * * @return a newly created read command that queries the {@code names} in {@code key}. The returned query will * query every columns (without limit or row filtering) and be in forward order. */ public static SinglePartitionReadCommand create(CFMetaData metadata, int nowInSec, DecoratedKey key, NavigableSet<Clustering> names) { ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(names, false); return create(metadata, nowInSec, ColumnFilter.all(metadata), RowFilter.NONE, DataLimits.NONE, key, filter); }
/** * Creates a new single partition name command for the provided rows. * * @param metadata the table to query. * @param nowInSec the time in seconds to use are "now" for this query. * @param key the partition key for the partition to query. * @param names the clustering for the rows to query. * * @return a newly created read command that queries the {@code names} in {@code key}. The returned query will * query every columns (without limit or row filtering) and be in forward order. */ public static SinglePartitionReadCommand create(CFMetaData metadata, int nowInSec, DecoratedKey key, NavigableSet<Clustering> names) { ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(names, false); return create(metadata, nowInSec, ColumnFilter.all(metadata), RowFilter.NONE, DataLimits.NONE, key, filter); }
public SinglePartitionReadCommand readCommand(int nowInSec) { assert staticConditions != null || !conditions.isEmpty(); // Fetch all columns, but query only the selected ones ColumnFilter columnFilter = ColumnFilter.selection(columnsToRead()); // With only a static condition, we still want to make the distinction between a non-existing partition and one // that exists (has some live data) but has not static content. So we query the first live row of the partition. if (conditions.isEmpty()) return SinglePartitionReadCommand.create(cfm, nowInSec, columnFilter, RowFilter.NONE, DataLimits.cqlLimits(1), key, new ClusteringIndexSliceFilter(Slices.ALL, false)); ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(conditions.navigableKeySet(), false); return SinglePartitionReadCommand.create(cfm, nowInSec, key, columnFilter, filter); }
public SinglePartitionReadCommand readCommand(int nowInSec) { assert staticConditions != null || !conditions.isEmpty(); // Fetch all columns, but query only the selected ones ColumnFilter columnFilter = ColumnFilter.selection(columnsToRead()); // With only a static condition, we still want to make the distinction between a non-existing partition and one // that exists (has some live data) but has not static content. So we query the first live row of the partition. if (conditions.isEmpty()) return SinglePartitionReadCommand.create(cfm, nowInSec, columnFilter, RowFilter.NONE, DataLimits.cqlLimits(1), key, new ClusteringIndexSliceFilter(Slices.ALL, false)); ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(conditions.navigableKeySet(), false); return SinglePartitionReadCommand.create(cfm, nowInSec, key, columnFilter, filter); }
public SinglePartitionReadCommand readCommand(int nowInSec) { assert staticConditions != null || !conditions.isEmpty(); // Fetch all columns, but query only the selected ones ColumnFilter columnFilter = ColumnFilter.selection(columnsToRead()); // With only a static condition, we still want to make the distinction between a non-existing partition and one // that exists (has some live data) but has not static content. So we query the first live row of the partition. if (conditions.isEmpty()) return SinglePartitionReadCommand.create(cfm, nowInSec, columnFilter, RowFilter.NONE, DataLimits.cqlLimits(1), key, new ClusteringIndexSliceFilter(Slices.ALL, false)); ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(conditions.navigableKeySet(), false); return SinglePartitionReadCommand.create(cfm, nowInSec, key, columnFilter, filter); }
public ClusteringIndexFilter deserialize(DataInputPlus in, int version, CFMetaData metadata, boolean reversed) throws IOException { ClusteringComparator comparator = metadata.comparator; BTreeSet.Builder<Clustering> clusterings = BTreeSet.builder(comparator); int size = (int)in.readUnsignedVInt(); for (int i = 0; i < size; i++) clusterings.add(Clustering.serializer.deserialize(in, version, comparator.subtypes())); return new ClusteringIndexNamesFilter(clusterings.build(), reversed); } }
public ClusteringIndexFilter deserialize(DataInputPlus in, int version, CFMetaData metadata, boolean reversed) throws IOException { ClusteringComparator comparator = metadata.comparator; BTreeSet.Builder<Clustering> clusterings = BTreeSet.builder(comparator); int size = (int)in.readUnsignedVInt(); for (int i = 0; i < size; i++) clusterings.add(Clustering.serializer.deserialize(in, version, comparator.subtypes())); return new ClusteringIndexNamesFilter(clusterings.build(), reversed); } }
public ClusteringIndexFilter deserialize(DataInputPlus in, int version, CFMetaData metadata, boolean reversed) throws IOException { ClusteringComparator comparator = metadata.comparator; BTreeSet.Builder<Clustering> clusterings = BTreeSet.builder(comparator); int size = (int)in.readUnsignedVInt(); for (int i = 0; i < size; i++) clusterings.add(Clustering.serializer.deserialize(in, version, comparator.subtypes())); return new ClusteringIndexNamesFilter(clusterings.build(), reversed); } }
public ClusteringIndexFilter deserialize(DataInputPlus in, int version, CFMetaData metadata, boolean reversed) throws IOException { ClusteringComparator comparator = metadata.comparator; BTreeSet.Builder<Clustering> clusterings = BTreeSet.builder(comparator); int size = (int)in.readUnsignedVInt(); for (int i = 0; i < size; i++) clusterings.add(Clustering.serializer.deserialize(in, version, comparator.subtypes())); return new ClusteringIndexNamesFilter(clusterings.build(), reversed); } }
private UpdateParameters makeUpdateParameters(Collection<ByteBuffer> keys, NavigableSet<Clustering> clusterings, QueryOptions options, boolean local, long now, long queryStartNanoTime) { if (clusterings.contains(Clustering.STATIC_CLUSTERING)) return makeUpdateParameters(keys, new ClusteringIndexSliceFilter(Slices.ALL, false), options, DataLimits.cqlLimits(1), local, now, queryStartNanoTime); return makeUpdateParameters(keys, new ClusteringIndexNamesFilter(clusterings, false), options, DataLimits.NONE, local, now, queryStartNanoTime); }
private ClusteringIndexFilter toInternalFilter(CFMetaData metadata, ColumnParent parent, SliceRange range) { if (metadata.isSuper() && parent.isSetSuper_column()) return new ClusteringIndexNamesFilter(FBUtilities.singleton(Clustering.make(parent.bufferForSuper_column()), metadata.comparator), range.reversed); else return new ClusteringIndexSliceFilter(makeSlices(metadata, range), range.reversed); }
private ClusteringIndexFilter toInternalFilter(CFMetaData metadata, ColumnParent parent, SliceRange range) { if (metadata.isSuper() && parent.isSetSuper_column()) return new ClusteringIndexNamesFilter(FBUtilities.singleton(Clustering.make(parent.bufferForSuper_column()), metadata.comparator), range.reversed); else return new ClusteringIndexSliceFilter(makeSlices(metadata, range), range.reversed); }