public class Slice
extends java.lang.Object
A slice has a start and an end bound that are both (potentially full) clustering prefixes. A slice selects every rows whose clustering is bigger than the slice start prefix but smaller than the end prefix. Both start and end can be either inclusive or exclusive.
Modifier and Type | Class and Description |
---|---|
static class |
Slice.Serializer |
Modifier and Type | Field and Description |
---|---|
static Slice |
ALL
The slice selecting all rows (of a given partition)
|
static Slice.Serializer |
serializer |
Modifier and Type | Method and Description |
---|---|
ClusteringBound<?> |
close(boolean reversed) |
ClusteringBound<?> |
end() |
boolean |
equals(java.lang.Object other) |
Slice |
forPaging(ClusteringComparator comparator,
Clustering<?> lastReturned,
boolean inclusive,
boolean reversed)
Returns a slice for continuing paging from the last returned clustering prefix.
|
int |
hashCode() |
boolean |
includes(ClusteringComparator comparator,
ClusteringPrefix<?> bound)
Returns whether a given clustering or bound is included in this slice.
|
boolean |
intersects(ClusteringComparator comparator,
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 slice potentially
intersects that sstable or not.
|
boolean |
isEmpty(ClusteringComparator comparator)
Return whether the slice is empty.
|
static boolean |
isEmpty(ClusteringComparator comparator,
ClusteringBound<?> start,
ClusteringBound<?> end)
Return whether the slice formed by the two provided bound is empty or not.
|
static Slice |
make(Clustering<?> clustering) |
static Slice |
make(Clustering<?> start,
Clustering<?> end) |
static Slice |
make(ClusteringBound<?> start,
ClusteringBound<?> end) |
static Slice |
make(ClusteringComparator comparator,
java.lang.Object... values) |
ClusteringBound<?> |
open(boolean reversed) |
ClusteringBound<?> |
start() |
java.lang.String |
toString(ClusteringComparator comparator) |
public static final Slice.Serializer serializer
public static final Slice ALL
public static Slice make(ClusteringBound<?> start, ClusteringBound<?> end)
public static Slice make(ClusteringComparator comparator, java.lang.Object... values)
public static Slice make(Clustering<?> clustering)
public static Slice make(Clustering<?> start, Clustering<?> end)
public ClusteringBound<?> start()
public ClusteringBound<?> end()
public ClusteringBound<?> open(boolean reversed)
public ClusteringBound<?> close(boolean reversed)
public boolean isEmpty(ClusteringComparator comparator)
comparator
- the comparator to compare the bounds.public static boolean isEmpty(ClusteringComparator comparator, ClusteringBound<?> start, ClusteringBound<?> end)
comparator
- the comparator to compare the bounds.start
- the start for the slice to consider. This must be a start bound.end
- the end for the slice to consider. This must be an end bound.start
and end
is
empty or not.public boolean includes(ClusteringComparator comparator, ClusteringPrefix<?> bound)
comparator
- the comparator for the table this is a slice of.bound
- the bound to test inclusion of.bound
is within the bounds of this slice.public Slice 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
, or null
if paging
the resulting slice selects nothing (i.e. if it originally selects nothing coming after lastReturned
).public boolean intersects(ClusteringComparator comparator, java.util.List<java.nio.ByteBuffer> minClusteringValues, java.util.List<java.nio.ByteBuffer> maxClusteringValues)
comparator
- the comparator for the table this is a slice of.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 java.lang.String toString(ClusteringComparator comparator)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2009-2022 The Apache Software Foundation