org.eobjects.analyzer.beans.api
Interface QueryOptimizedFilter<C extends Enum<C>>

Type Parameters:
C - the filter category enum
All Superinterfaces:
Filter<C>
All Known Implementing Classes:
EqualsFilter, MaxRowsFilter, NullCheckFilter

public interface QueryOptimizedFilter<C extends Enum<C>>
extends Filter<C>

A filter which can, under certain circumstances, be optimized by using a "push down" technique, where the filter's functionality is expressed in the query that feeds the job that the filter is entered into. Query optimized filters should implement BOTH the regular categorize(...) method and the optimization-methods in this interface. There is no guarantee that the filter will be optimizing the query, but in cases where a filter is among the first steps in a job, and all succeeding steps depend on a single outcome of the particular filter, it will be allowed to optimize the query.

Author:
Kasper Sørensen

Method Summary
 boolean isOptimizable(C category)
          Inquires the filter if a given category is optimizable by the use of a query.
 Query optimizeQuery(Query q, C category)
          Optimizes the filter execution by retrieving a query (as opposed to invoking the categorize(...) method for each row).
 
Methods inherited from interface org.eobjects.analyzer.beans.api.Filter
categorize
 

Method Detail

isOptimizable

boolean isOptimizable(C category)
Inquires the filter if a given category is optimizable by the use of a query.

Parameters:
category - the category to optimize
Returns:
a boolean indicating whether or not the provided category is query optimizable.

optimizeQuery

Query optimizeQuery(Query q,
                    C category)
Optimizes the filter execution by retrieving a query (as opposed to invoking the categorize(...) method for each row). This method will only be invoked if a preceding call to isOptimizable(...) with the same category returned true.

Parameters:
q - the query to optimize.
category - the filter category to optimize.
Returns:
a new query (or a mutated version of the parameterized query) that includes query optimization.


Copyright © 2012 eobjects.org. All Rights Reserved.