public abstract class Slices extends java.lang.Object implements java.lang.Iterable<Slice>
A Slices
is basically a list of Slice
, though those are guaranteed to be non-overlapping
and always in clustering order.
Modifier and Type | Class and Description |
---|---|
static class |
Slices.Builder
Builder to create
Slices objects. |
static interface |
Slices.InOrderTester
In simple object that allows to test the inclusion of rows in those slices assuming those rows
are passed (to
Slices.InOrderTester.includes(org.apache.cassandra.db.Clustering<?>) ) in clustering order (or reverse clustering ordered, depending
of the argument passed to inOrderTester(boolean) ). |
static class |
Slices.Serializer |
Modifier and Type | Field and Description |
---|---|
static Slices |
ALL
Slices selecting all the rows of a partition.
|
static Slices |
NONE
Slices selecting no rows in a partition.
|
static Slices.Serializer |
serializer |
Modifier | Constructor and Description |
---|---|
protected |
Slices() |
Modifier and Type | Method and Description |
---|---|
abstract Slices |
forPaging(ClusteringComparator comparator,
Clustering<?> lastReturned,
boolean inclusive,
boolean reversed)
Returns slices for continuing the paging of those slices given the last returned clustering prefix.
|
abstract Slice |
get(int i)
Returns the ith slice of this
Slices object. |
abstract boolean |
hasLowerBound()
Whether the slices has a lower bound, that is whether it's first slice start is
Slice.BOTTOM . |
abstract boolean |
hasUpperBound()
Whether the slices has an upper bound, that is whether it's last slice end is
Slice.TOP . |
abstract Slices.InOrderTester |
inOrderTester(boolean reversed)
An object that allows to test whether rows are selected by this
Slices objects assuming those rows
are tested in clustering order. |
abstract boolean |
intersects(java.util.List<java.nio.ByteBuffer> minClusteringValues,
java.util.List<java.nio.ByteBuffer> maxClusteringValues)
Given the per-clustering column minimum and maximum value a sstable contains, whether or not this slices potentially
intersects that sstable or not.
|
boolean |
isEmpty()
Checks if this
Slices is empty. |
abstract boolean |
selects(Clustering<?> clustering)
Whether a given clustering (row) is selected by this
Slices object. |
abstract int |
size()
The number of slice this object contains.
|
abstract java.lang.String |
toCQLString(TableMetadata metadata) |
static Slices |
with(ClusteringComparator comparator,
Slice slice)
Creates a
Slices object that contains a single slice. |
public static final Slices.Serializer serializer
public static final Slices ALL
public static final Slices NONE
public static Slices with(ClusteringComparator comparator, Slice slice)
Slices
object that contains a single slice.comparator
- the comparator for the table slice
is a slice of.slice
- the single slice that the return object should contains.Slices
object.public abstract boolean hasLowerBound()
Slice.BOTTOM
.public abstract boolean hasUpperBound()
Slice.TOP
.public abstract int size()
public abstract Slice get(int i)
Slices
object.public abstract Slices forPaging(ClusteringComparator comparator, Clustering<?> lastReturned, boolean inclusive, boolean reversed)
comparator
- the comparator for the table this is a filter for.lastReturned
- the last clustering that was returned for the query we are paging for. The
resulting slices will be such that only results coming stricly after lastReturned
are returned
(where coming after means "greater than" if !reversed
and "lesser than" otherwise).inclusive
- whether or not we want to include the lastReturned
in the newly returned page of results.reversed
- whether the query we're paging for is reversed or not.lastReturned
.public abstract Slices.InOrderTester inOrderTester(boolean reversed)
Slices
objects assuming those rows
are tested in clustering order.reversed
- if true, the rows passed to the returned object will be assumed to be in reversed clustering
order, otherwise they should be in clustering order.Slices
object.public abstract boolean selects(Clustering<?> clustering)
Slices
object.clustering
- the clustering to test for selection.Slices
object.public abstract boolean intersects(java.util.List<java.nio.ByteBuffer> minClusteringValues, java.util.List<java.nio.ByteBuffer> maxClusteringValues)
minClusteringValues
- the smallest values for each clustering column that a sstable contains.maxClusteringValues
- the biggest values for each clustering column that a sstable contains.minClusteringValues
and
maxClusteringValues
.public abstract java.lang.String toCQLString(TableMetadata metadata)
public final boolean isEmpty()
Slices
is empty.true
if this Slices
is empty, false
otherwise.Copyright © 2009-2022 The Apache Software Foundation