public class CompositeRangePredicate extends Object implements Predicate, IndexAwarePredicate
GreaterLessPredicate
, BetweenPredicate
and BoundedRangePredicate
but for composite indexes and values.Constructor and Description |
---|
CompositeRangePredicate(InternalIndex index,
CompositeValue from,
boolean fromInclusive,
CompositeValue to,
boolean toInclusive,
int prefixLength)
Constructs a new composite range predicate on the given index.
|
Modifier and Type | Method and Description |
---|---|
boolean |
apply(Map.Entry entry)
Applies this predicate to the given map entry.
|
Set<QueryableEntry> |
filter(QueryContext queryContext)
Produces a filtered entry set by utilizing the indexes available while
executing the query in the given query context.
|
boolean |
isIndexed(QueryContext queryContext)
Signals to the query engine that this predicate is able to utilize the
indexes available while executing the query in the given query context.
|
String |
toString() |
public CompositeRangePredicate(InternalIndex index, CompositeValue from, boolean fromInclusive, CompositeValue to, boolean toInclusive, int prefixLength)
index
- the index to construct the predicate on.from
- the lower/left range bound.fromInclusive
- true
if the range is left-closed,
false
otherwise.to
- the upper/right range bound.toInclusive
- true
if the range is right-closed,
false
otherwise.public boolean apply(Map.Entry entry)
Predicate
Implementations must be thread-safe, since this method may be called by multiple threads concurrently.
public Set<QueryableEntry> filter(QueryContext queryContext)
IndexAwarePredicate
The query engine assumes this method produces the result set faster than a simple evaluation of the predicate on every entry.
filter
in interface IndexAwarePredicate
queryContext
- the query context to access the indexes. The passed
query context is valid only for a duration of a single
call to the method.public boolean isIndexed(QueryContext queryContext)
IndexAwarePredicate
isIndexed
in interface IndexAwarePredicate
queryContext
- the query context to consult for the available
indexes.true
if this predicate is able to use the indexes to
speed up the processing, false
otherwise.Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.