K- the type of keys the predicate operates on.
V- the type of values the predicate operates on.
public interface IndexAwarePredicate<K,V> extends Predicate<K,V>
Predicateinterface with the ability to support indexes.
The general contract is:
isIndexed(com.hazelcast.query.impl.QueryContext)method of the index-aware predicate and provides it with the
QueryContextinstance. The predicate may consult the passed query context regarding the indexes configured for the map in question and decide whether it is possible to use the indexes to speed up the query processing or not.
filter(com.hazelcast.query.impl.QueryContext)method is invoked by the query engine to obtain a filtered entry set. The query engine assumes that this obtained result set is consistent with the entry set at the time the result set was produced. In other words, all the entries for which the predicate
trueare included in the result set and all the entries for which the predicate evaluates to
falseare excluded from the result set.
Predicate.apply(java.util.Map.Entry<K, V>)method of the predicate.
|Modifier and Type||Method and Description|
Produces a filtered entry set by utilizing the indexes available while executing the query in the given query context.
Signals to the query engine that this predicate is able to utilize the indexes available while executing the query in the given query context.
Set<com.hazelcast.query.impl.QueryableEntry<K,V>> filter(com.hazelcast.query.impl.QueryContext queryContext)
The query engine assumes this method produces the result set faster than a simple evaluation of the predicate on every entry.
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.
boolean isIndexed(com.hazelcast.query.impl.QueryContext queryContext)
queryContext- the query context to consult for the available indexes.
trueif this predicate is able to use the indexes to speed up the processing,
Copyright © 2019 Hazelcast, Inc.. All rights reserved.