Interface QueryRecorderFilter<T>
- All Superinterfaces:
Filter<T>
,Serializable
- All Known Implementing Classes:
AbstractQueryRecorderFilter
,AllFilter
,AlwaysFilter
,AndFilter
,AnyFilter
,ArrayFilter
,BetweenFilter
,ComparisonFilter
,ContainsAllFilter
,ContainsAnyFilter
,ContainsFilter
,EqualsFilter
,ExtractorFilter
,GreaterEqualsFilter
,GreaterFilter
,InFilter
,InKeySetFilter
,IsNotNullFilter
,IsNullFilter
,LessEqualsFilter
,LessFilter
,LikeFilter
,LimitFilter
,NeverFilter
,NotEqualsFilter
,NotFilter
,OrFilter
,PredicateFilter
,RegexFilter
,WrapperQueryRecorderFilter
,XorFilter
During a query execution each filter performs one or more logical operations
called "steps". Filters that implement this interface are expected
to produce an estimated cost of execution by the
explain
method
and the actual execution cost by the
trace(QueryContext, com.tangosol.util.QueryRecord.PartialResult.TraceStep, java.util.Set)
and
trace(QueryContext, com.tangosol.util.QueryRecord.PartialResult.TraceStep, java.util.Map.Entry)
methods.
- Since:
- Coherence 3.7.1
- Author:
- tb 2011.05.26
-
Method Summary
Modifier and TypeMethodDescriptionvoid
explain
(QueryContext ctx, QueryRecord.PartialResult.ExplainStep step, Set setKeys) Record the projected query execution cost by this filter.boolean
trace
(QueryContext ctx, QueryRecord.PartialResult.TraceStep step, Map.Entry entry) Evaluate the specified entry against this filter and record the evaluation cost on the given step of theQueryRecord
.trace
(QueryContext ctx, QueryRecord.PartialResult.TraceStep step, Set setKeys) Filter the given keys using available indexes and record the cost of execution on the given step of theQueryRecord
.Methods inherited from interface com.tangosol.util.Filter
and, asLimitFilter, associatedWith, evaluate, forKeys, forPartitions, or, xor
-
Method Details
-
explain
Record the projected query execution cost by this filter.This method is expected to record the order of execution and estimated cost of applying corresponding indexes in the given
step
without actually applying any indexes or evaluating entries.- Parameters:
ctx
- the query contextstep
- the step used to record the estimated execution costsetKeys
- the set of keys that would be filtered
-
trace
Filter the given keys using available indexes and record the cost of execution on the given step of theQueryRecord
.This method should record the size of the given key set before and after applying corresponding indexes using
QueryRecord.PartialResult.RecordableStep.recordPreFilterKeys(int)
andQueryRecord.PartialResult.TraceStep.recordPostFilterKeys(int)
as well as the corresponding execution time using theQueryRecord.PartialResult.TraceStep.recordDuration(long)
method.This method is only called if the filter is an
IndexAwareFilter
and its implementations should explicitly callapplyIndex()
to actually perform the query. Additionally, this method should return the filter object (if any) returned by the applyIndex() call.- Parameters:
ctx
- the query contextstep
- the step used to record the execution costsetKeys
- the mutable set of keys that remain to be filtered- Returns:
- the filter returned from
IndexAwareFilter.applyIndex(Map, Set)
-
trace
Evaluate the specified entry against this filter and record the evaluation cost on the given step of theQueryRecord
.This method should record the corresponding latencies using
QueryRecord.PartialResult.TraceStep.recordDuration(long)
.Implementations are responsible for explicitly calling
evaluateEntry()
method to perform the actual entry evaluation. Additionally, this method should return the result of the evaluateEntry call.- Parameters:
ctx
- the contextstep
- the step used to record the evaluation costentry
- the entry to evaluate- Returns:
- the result returned from
EntryFilter.evaluateEntry(Map.Entry)
-