public final class EvaluatePredicate extends Object implements Predicate, IndexAwarePredicate
Index.canEvaluate(java.lang.Class<? extends com.hazelcast.query.Predicate>)
returned true
.
Used during predicate tree optimization done by EvaluateVisitor
.
Never transferred over the wire.
Constructor and Description |
---|
EvaluatePredicate(Predicate predicate,
String indexName)
Constructs
EvaluatePredicate instance for the given predicate
which can be evaluated by the given index identified by its name. |
Modifier and Type | Method and Description |
---|---|
boolean |
apply(Map.Entry mapEntry)
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.
|
String |
getIndexName() |
Predicate |
getPredicate() |
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 EvaluatePredicate(Predicate predicate, String indexName)
EvaluatePredicate
instance for the given predicate
which can be evaluated by the given index identified by its name.predicate
- the evaluable predicate to wrap.indexName
- the index which can evaluate the given predicate.public Predicate getPredicate()
public String getIndexName()
public boolean apply(Map.Entry mapEntry)
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 © 2020 Hazelcast, Inc.. All Rights Reserved.