Class AbstractQueryRecorderFilter<T>

    • Constructor Detail

      • AbstractQueryRecorderFilter

        public AbstractQueryRecorderFilter()
    • Method Detail

      • explain

        public void explain​(QueryContext ctx,
                            QueryRecord.PartialResult.ExplainStep step,
                            Set setKeys)
        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.

        Specified by:
        explain in interface QueryRecorderFilter<T>
        Parameters:
        ctx - the query context
        step - the step used to record the estimated execution cost
        setKeys - the set of keys that would be filtered
      • explain

        protected static <T> void explain​(Filter<T> filter,
                                          Map mapIndexes,
                                          Set setKeys,
                                          QueryRecord.PartialResult.ExplainStep step)
        Record an estimated cost of query execution for a given filter.
        Type Parameters:
        T - the type of the input argument to the filter
        Parameters:
        filter - the filter
        mapIndexes - a read-only map of available MapIndex objects, keyed by the associated ValueExtractor
        setKeys - the mutable set of keys that remain to be filtered
        step - the step used to record the execution cost
      • explain

        protected static <T> void explain​(Filter<T> filter,
                                          Map mapIndexes,
                                          Set setKeys,
                                          QueryRecord.PartialResult.ExplainStep step,
                                          ValueExtractor extractor)
        Record an estimated cost of query execution for a given filter.
        Type Parameters:
        T - the type of the input argument to the filter
        Parameters:
        filter - the filter
        mapIndexes - a read-only map of available MapIndex objects, keyed by the associated ValueExtractor
        setKeys - the mutable set of keys that remain to be filtered
        step - the step used to record the execution cost
        extractor - an optional ValueExtractor used by the query
      • trace

        protected static <T> Filter<T> trace​(Filter<T> filter,
                                             Map mapIndexes,
                                             Set setKeys,
                                             QueryRecord.PartialResult.TraceStep step)
        Record the actual cost of applying the specified filter to the specified keySet.
        Type Parameters:
        T - the type of the input argument to the filter
        Parameters:
        filter - the filter
        mapIndexes - a read-only map of available MapIndex objects, keyed by the associated ValueExtractor
        setKeys - the mutable set of keys that remain to be filtered
        step - the step used to record the execution cost
        Returns:
        a Filter object (which may be an EntryFilter) that can be used to process the remaining keys, or null if no additional filter processing is necessary
      • trace

        protected static <T> Filter<T> trace​(Filter<T> filter,
                                             Map mapIndexes,
                                             Set setKeys,
                                             QueryRecord.PartialResult.TraceStep step,
                                             ValueExtractor extractor)
        Record the actual cost of applying the specified filter to the specified keySet.
        Type Parameters:
        T - the type of the input argument to the filter
        Parameters:
        filter - the filter
        mapIndexes - a read-only map of available MapIndex objects, keyed by the associated ValueExtractor
        setKeys - the mutable set of keys that remain to be filtered
        step - the step used to record the execution cost
        extractor - an optional ValueExtractor used by the query
        Returns:
        a Filter object (which may be an EntryFilter) that can be used to process the remaining keys, or null if no additional filter processing is necessary
      • trace

        protected static <T> boolean trace​(Filter<T> filter,
                                           Map.Entry entry,
                                           QueryRecord.PartialResult.TraceStep step)
        Record the actual cost of query execution for a given filter.
        Type Parameters:
        T - the type of the input argument to the filter
        Parameters:
        filter - the filter
        entry - the entry to be evaluated
        step - the step used to record the execution cost
        Returns:
        true if the entry passes the filter, false otherwise