com.espertech.esper.epl.core
Interface MethodResolutionService

All Known Implementing Classes:
MethodResolutionServiceImpl

public interface MethodResolutionService

Service for resolving methods and aggregation functions, and for creating managing aggregation instances.


Method Summary
 void destroyedAgentInstance(int agentInstanceId)
           
 java.lang.Class getAvgAggregatorType(java.lang.Class childType)
           
 java.lang.Object getCriteriaKeyBinding(ExprEvaluator[] evaluators)
           
 long getCurrentRowCount(AggregationMethod[] aggregators, AggregationState[] states)
          Returns the current row count of an aggregation, for use with resilience.
 EngineImportService getEngineImportService()
           
 java.lang.Object getGroupKeyBinding(AggregationLocalGroupByPlan localGroupByPlan)
           
 java.lang.Object getGroupKeyBinding(ExprNode[] groupKeyExpressions, AggregationGroupByRollupDesc groupByRollupDesc)
           
 java.lang.Class getSumAggregatorType(java.lang.Class inputValueType)
           
 boolean isDuckType()
           
 boolean isSortUsingCollator()
           
 boolean isUdfCache()
          Returns true to cache UDF results for constant parameter sets.
 AggregationState makeAccessAggLinearJoin(int agentInstanceId, int groupId, int aggregationId, int streamNum)
           
 AggregationState makeAccessAggLinearNonJoin(int agentInstanceId, int groupId, int aggregationId, int streamNum)
           
 AggregationState makeAccessAggMinMaxEver(int agentInstanceId, int groupId, int aggregationId, AggregationStateMinMaxByEverSpec spec)
           
 AggregationState makeAccessAggPlugin(int agentInstanceId, int groupId, int aggregationId, boolean join, PlugInAggregationMultiFunctionStateFactory providerFactory, java.lang.Object groupKey)
           
 AggregationState makeAccessAggSortedJoin(int agentInstanceId, int groupId, int aggregationId, AggregationStateSortedSpec spec)
           
 AggregationState makeAccessAggSortedNonJoin(int agentInstanceId, int groupId, int aggregationId, AggregationStateSortedSpec spec)
           
 AggregationMethod makeAvedevAggregator(int agentInstanceId, int groupId, int aggregationId, boolean hasFilter)
          Makes a new avedev-aggregator.
 AggregationMethod makeAvgAggregator(int agentInstanceId, int groupId, int aggregationId, java.lang.Class type, boolean hasFilter)
          Makes a new avg-aggregator.
 AggregationMethod makeCountAggregator(int agentInstanceId, int groupId, int aggregationId, boolean isIgnoreNull, boolean hasFilter)
          Makes a new count-aggregator.
 AggregationMethod makeCountEverValueAggregator(int agentInstanceId, int groupId, int aggregationId, boolean hasFilter, boolean ignoreNulls)
          Makes a new countever-value aggregator.
 AggregationState makeCountMinSketch(int agentInstanceId, int groupId, int aggregationId, CountMinSketchSpec specification)
           
 AggregationMethod makeDistinctAggregator(int agentInstanceId, int groupId, int aggregationId, AggregationMethod aggregationMethod, java.lang.Class childType, boolean hasFilter)
          Makes a new distinct-value-aggregator.
 AggregationMethod makeFirstEverValueAggregator(int agentInstanceId, int groupId, int aggregationId, java.lang.Class type, boolean hasFilter)
          Makes a new first-value aggregator.
 AggregationMethod makeLastEverValueAggregator(int agentInstanceId, int groupId, int aggregationId, java.lang.Class type, boolean hasFilter)
          Makes a new last-value aggregator.
 AggregationMethod makeLeavingAggregator(int agentInstanceId, int groupId, int aggregationId)
          Make leaving agg.
 AggregationMethod makeMedianAggregator(int agentInstanceId, int groupId, int aggregationId, boolean hasFilter)
          Makes a new median-aggregator.
 AggregationMethod makeMinMaxAggregator(int agentInstanceId, int groupId, int aggregationId, MinMaxTypeEnum minMaxType, java.lang.Class targetType, boolean isHasDataWindows, boolean hasFilter)
          Makes a new min-max-aggregator.
 AggregationMethod makeNthAggregator(int agentInstanceId, int groupId, int aggregationId, java.lang.Class returnType, int size)
          Makes a Nth element aggregator.
 AggregationMethod makeRateAggregator(int agentInstanceId, int groupId, int aggregationId)
          Makes a new rate-aggregator.
 AggregationMethod makeRateEverAggregator(int agentInstanceId, int groupId, int aggregationId, long interval)
          Makes a new rate-aggregator.
 AggregationMethod makeStddevAggregator(int agentInstanceId, int groupId, int aggregationId, boolean hasFilter)
          Makes a new stddev-aggregator.
 AggregationMethod makeSumAggregator(int agentInstanceId, int groupId, int aggregationId, java.lang.Class type, boolean hasFilter)
          Makes a new sum-aggregator.
 AggregationState[] newAccesses(int agentInstanceId, boolean isJoin, AggregationStateFactory[] accessAggSpecs)
           
 AggregationState[] newAccesses(int agentInstanceId, boolean isJoin, AggregationStateFactory[] accessAggSpecs, java.lang.Object groupKey, java.lang.Object groupKeyBinding, AggregationGroupByRollupLevel groupByRollupLevel)
           
 AggregationMethod[] newAggregators(AggregationMethodFactory[] aggregators, int agentInstanceId)
          Returns a new set of aggregators given an existing prototype-set of aggregators for a given context partition (no groups).
 AggregationMethod[] newAggregators(AggregationMethodFactory[] prototypes, int agentInstanceId, java.lang.Object groupKey, java.lang.Object groupKeyBinding, AggregationGroupByRollupLevel groupByRollupLevel)
          Returns a new set of aggregators given an existing prototype-set of aggregators for a given context partition and group key.
 void removeAggregators(int agentInstanceId, java.lang.Object groupKey, java.lang.Object groupKeyBinding, AggregationGroupByRollupLevel level)
          Opportunity to remove aggregations for a group.
 AggregationFunctionFactory resolveAggregationFactory(java.lang.String functionName)
          Returns a plug-in aggregation function factory for a given configured aggregation function name.
 java.lang.Class resolveClass(java.lang.String className)
          Resolves a given class name, either fully qualified and simple and imported to a class.
 java.lang.reflect.Constructor resolveCtor(java.lang.Class clazz, java.lang.Class[] paramTypes)
          Resolves matching available constructors to a list of parameter types to an instance or static method exposed by the given class.
 java.lang.reflect.Method resolveMethod(java.lang.Class clazz, java.lang.String methodName, java.lang.Class[] paramTypes, boolean[] allowEventBeanType, boolean[] allowEventBeanCollType)
          Resolves a given method name and list of parameter types to an instance or static method exposed by the given class.
 java.lang.reflect.Method resolveMethod(java.lang.String className, java.lang.String methodName)
          Resolves a given class and method name to a static method, not allowing overloaded methods and expecting the method to be found exactly once with zero or more parameters.
 java.lang.reflect.Method resolveMethod(java.lang.String className, java.lang.String methodName, java.lang.Class[] paramTypes, boolean[] allowEventBeanType, boolean[] allowEventBeanCollType)
          Resolves a given class, method and list of parameter types to a static method.
 java.lang.reflect.Method resolveNonStaticMethod(java.lang.Class clazz, java.lang.String methodName)
          Resolves a given class and method name to a non-static method, not allowing overloaded methods and expecting the method to be found exactly once with zero or more parameters.
 Pair<java.lang.Class,EngineImportSingleRowDesc> resolveSingleRow(java.lang.String functionName)
          Used at statement compile-time to try and resolve a given function name into an single-row function.
 

Method Detail

isUdfCache

boolean isUdfCache()
Returns true to cache UDF results for constant parameter sets.

Returns:
cache UDF results config

isDuckType

boolean isDuckType()

isSortUsingCollator

boolean isSortUsingCollator()

resolveMethod

java.lang.reflect.Method resolveMethod(java.lang.Class clazz,
                                       java.lang.String methodName,
                                       java.lang.Class[] paramTypes,
                                       boolean[] allowEventBeanType,
                                       boolean[] allowEventBeanCollType)
                                       throws EngineImportException
Resolves a given method name and list of parameter types to an instance or static method exposed by the given class.

Parameters:
clazz - is the class to look for a fitting method
methodName - is the method name
paramTypes - is parameter types match expression sub-nodes
Returns:
method this resolves to
Throws:
EngineImportException - if the method cannot be resolved to a visible static or instance method

resolveCtor

java.lang.reflect.Constructor resolveCtor(java.lang.Class clazz,
                                          java.lang.Class[] paramTypes)
                                          throws EngineImportException
Resolves matching available constructors to a list of parameter types to an instance or static method exposed by the given class.

Parameters:
clazz - is the class to look for a fitting method
paramTypes - is parameter types match expression sub-nodes
Returns:
method this resolves to
Throws:
EngineImportException - if the method cannot be resolved to a visible static or instance method

resolveMethod

java.lang.reflect.Method resolveMethod(java.lang.String className,
                                       java.lang.String methodName,
                                       java.lang.Class[] paramTypes,
                                       boolean[] allowEventBeanType,
                                       boolean[] allowEventBeanCollType)
                                       throws EngineImportException
Resolves a given class, method and list of parameter types to a static method.

Parameters:
className - is the class name to use
methodName - is the method name
paramTypes - is parameter types match expression sub-nodes
allowEventBeanType - allow event bean type footprint
Returns:
method this resolves to
Throws:
EngineImportException - if the method cannot be resolved to a visible static method

resolveMethod

java.lang.reflect.Method resolveMethod(java.lang.String className,
                                       java.lang.String methodName)
                                       throws EngineImportException
Resolves a given class and method name to a static method, not allowing overloaded methods and expecting the method to be found exactly once with zero or more parameters.

Parameters:
className - is the class name to use
methodName - is the method name
Returns:
method this resolves to
Throws:
EngineImportException - if the method cannot be resolved to a visible static method, or if the method exists more then once with different parameters

resolveNonStaticMethod

java.lang.reflect.Method resolveNonStaticMethod(java.lang.Class clazz,
                                                java.lang.String methodName)
                                                throws EngineImportException
Resolves a given class and method name to a non-static method, not allowing overloaded methods and expecting the method to be found exactly once with zero or more parameters.

Parameters:
clazz - is the clazz to use
methodName - is the method name
Returns:
method this resolves to
Throws:
EngineImportException - if the method cannot be resolved to a visible static method, or if the method exists more then once with different parameters

resolveClass

java.lang.Class resolveClass(java.lang.String className)
                             throws EngineImportException
Resolves a given class name, either fully qualified and simple and imported to a class.

Parameters:
className - is the class name to use
Returns:
class this resolves to
Throws:
EngineImportException - if there was an error resolving the class

resolveAggregationFactory

AggregationFunctionFactory resolveAggregationFactory(java.lang.String functionName)
                                                     throws EngineImportUndefinedException,
                                                            EngineImportException
Returns a plug-in aggregation function factory for a given configured aggregation function name.

Parameters:
functionName - is the aggregation function name
Returns:
aggregation-factory
Throws:
EngineImportUndefinedException - is the function name cannot be found
EngineImportException - if there was an error resolving class information

resolveSingleRow

Pair<java.lang.Class,EngineImportSingleRowDesc> resolveSingleRow(java.lang.String functionName)
                                                                 throws EngineImportUndefinedException,
                                                                        EngineImportException
Used at statement compile-time to try and resolve a given function name into an single-row function. Matches function name case-neutral.

Parameters:
functionName - is the function name
Throws:
EngineImportUndefinedException - if the function is not a configured single-row function
EngineImportException - if the function providing class could not be loaded or doesn't match

makeCountAggregator

AggregationMethod makeCountAggregator(int agentInstanceId,
                                      int groupId,
                                      int aggregationId,
                                      boolean isIgnoreNull,
                                      boolean hasFilter)
Makes a new count-aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
isIgnoreNull - is true to ignore nulls, or false to count nulls @return aggregator

makeFirstEverValueAggregator

AggregationMethod makeFirstEverValueAggregator(int agentInstanceId,
                                               int groupId,
                                               int aggregationId,
                                               java.lang.Class type,
                                               boolean hasFilter)
Makes a new first-value aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
type - of value @return aggregator

makeCountEverValueAggregator

AggregationMethod makeCountEverValueAggregator(int agentInstanceId,
                                               int groupId,
                                               int aggregationId,
                                               boolean hasFilter,
                                               boolean ignoreNulls)
Makes a new countever-value aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
ignoreNulls -

makeLastEverValueAggregator

AggregationMethod makeLastEverValueAggregator(int agentInstanceId,
                                              int groupId,
                                              int aggregationId,
                                              java.lang.Class type,
                                              boolean hasFilter)
Makes a new last-value aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
type - of value @return aggregator

makeSumAggregator

AggregationMethod makeSumAggregator(int agentInstanceId,
                                    int groupId,
                                    int aggregationId,
                                    java.lang.Class type,
                                    boolean hasFilter)
Makes a new sum-aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
type - is the type to be summed up, i.e. float, long etc. @return aggregator

getSumAggregatorType

java.lang.Class getSumAggregatorType(java.lang.Class inputValueType)

makeDistinctAggregator

AggregationMethod makeDistinctAggregator(int agentInstanceId,
                                         int groupId,
                                         int aggregationId,
                                         AggregationMethod aggregationMethod,
                                         java.lang.Class childType,
                                         boolean hasFilter)
Makes a new distinct-value-aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
aggregationMethod - is the inner aggregation method
childType - is the return type of the inner expression to aggregate, if any @return aggregator

makeAvgAggregator

AggregationMethod makeAvgAggregator(int agentInstanceId,
                                    int groupId,
                                    int aggregationId,
                                    java.lang.Class type,
                                    boolean hasFilter)
Makes a new avg-aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
type - the expression return type @return aggregator

getAvgAggregatorType

java.lang.Class getAvgAggregatorType(java.lang.Class childType)

makeAvedevAggregator

AggregationMethod makeAvedevAggregator(int agentInstanceId,
                                       int groupId,
                                       int aggregationId,
                                       boolean hasFilter)
Makes a new avedev-aggregator.

Returns:
aggregator

makeMedianAggregator

AggregationMethod makeMedianAggregator(int agentInstanceId,
                                       int groupId,
                                       int aggregationId,
                                       boolean hasFilter)
Makes a new median-aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
hasFilter -
Returns:
aggregator

makeMinMaxAggregator

AggregationMethod makeMinMaxAggregator(int agentInstanceId,
                                       int groupId,
                                       int aggregationId,
                                       MinMaxTypeEnum minMaxType,
                                       java.lang.Class targetType,
                                       boolean isHasDataWindows,
                                       boolean hasFilter)
Makes a new min-max-aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
minMaxType - dedicates whether to do min or max
targetType - is the type to max or min
isHasDataWindows - true for has data windows @return aggregator to use

makeStddevAggregator

AggregationMethod makeStddevAggregator(int agentInstanceId,
                                       int groupId,
                                       int aggregationId,
                                       boolean hasFilter)
Makes a new stddev-aggregator.

Returns:
aggregator

makeRateAggregator

AggregationMethod makeRateAggregator(int agentInstanceId,
                                     int groupId,
                                     int aggregationId)
Makes a new rate-aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
Returns:
aggregator

makeRateEverAggregator

AggregationMethod makeRateEverAggregator(int agentInstanceId,
                                         int groupId,
                                         int aggregationId,
                                         long interval)
Makes a new rate-aggregator.

Parameters:
interval - seconds
Returns:
aggregator to use

makeNthAggregator

AggregationMethod makeNthAggregator(int agentInstanceId,
                                    int groupId,
                                    int aggregationId,
                                    java.lang.Class returnType,
                                    int size)
Makes a Nth element aggregator.

Parameters:
agentInstanceId -
groupId -
aggregationId -
returnType - of aggregation
size - of elements @return aggregator

makeLeavingAggregator

AggregationMethod makeLeavingAggregator(int agentInstanceId,
                                        int groupId,
                                        int aggregationId)
Make leaving agg.

Parameters:
agentInstanceId -
groupId -
aggregationId -
Returns:
agg

newAggregators

AggregationMethod[] newAggregators(AggregationMethodFactory[] prototypes,
                                   int agentInstanceId,
                                   java.lang.Object groupKey,
                                   java.lang.Object groupKeyBinding,
                                   AggregationGroupByRollupLevel groupByRollupLevel)
Returns a new set of aggregators given an existing prototype-set of aggregators for a given context partition and group key.

Parameters:
prototypes - is the prototypes
agentInstanceId - context partition
groupKey - is the key to group-by for
groupByRollupLevel -
Returns:
new set of aggregators for this group

newAggregators

AggregationMethod[] newAggregators(AggregationMethodFactory[] aggregators,
                                   int agentInstanceId)
Returns a new set of aggregators given an existing prototype-set of aggregators for a given context partition (no groups).

Parameters:
agentInstanceId - context partition
Returns:
new set of aggregators for this group

removeAggregators

void removeAggregators(int agentInstanceId,
                       java.lang.Object groupKey,
                       java.lang.Object groupKeyBinding,
                       AggregationGroupByRollupLevel level)
Opportunity to remove aggregations for a group.

Parameters:
agentInstanceId -
groupKey - that is no longer used
level -

getCurrentRowCount

long getCurrentRowCount(AggregationMethod[] aggregators,
                        AggregationState[] states)
Returns the current row count of an aggregation, for use with resilience.

Parameters:
aggregators - aggregators
Returns:
row count

destroyedAgentInstance

void destroyedAgentInstance(int agentInstanceId)

getEngineImportService

EngineImportService getEngineImportService()

newAccesses

AggregationState[] newAccesses(int agentInstanceId,
                               boolean isJoin,
                               AggregationStateFactory[] accessAggSpecs)

newAccesses

AggregationState[] newAccesses(int agentInstanceId,
                               boolean isJoin,
                               AggregationStateFactory[] accessAggSpecs,
                               java.lang.Object groupKey,
                               java.lang.Object groupKeyBinding,
                               AggregationGroupByRollupLevel groupByRollupLevel)

makeAccessAggLinearNonJoin

AggregationState makeAccessAggLinearNonJoin(int agentInstanceId,
                                            int groupId,
                                            int aggregationId,
                                            int streamNum)

makeAccessAggLinearJoin

AggregationState makeAccessAggLinearJoin(int agentInstanceId,
                                         int groupId,
                                         int aggregationId,
                                         int streamNum)

makeAccessAggSortedNonJoin

AggregationState makeAccessAggSortedNonJoin(int agentInstanceId,
                                            int groupId,
                                            int aggregationId,
                                            AggregationStateSortedSpec spec)

makeAccessAggSortedJoin

AggregationState makeAccessAggSortedJoin(int agentInstanceId,
                                         int groupId,
                                         int aggregationId,
                                         AggregationStateSortedSpec spec)

makeAccessAggMinMaxEver

AggregationState makeAccessAggMinMaxEver(int agentInstanceId,
                                         int groupId,
                                         int aggregationId,
                                         AggregationStateMinMaxByEverSpec spec)

makeAccessAggPlugin

AggregationState makeAccessAggPlugin(int agentInstanceId,
                                     int groupId,
                                     int aggregationId,
                                     boolean join,
                                     PlugInAggregationMultiFunctionStateFactory providerFactory,
                                     java.lang.Object groupKey)

makeCountMinSketch

AggregationState makeCountMinSketch(int agentInstanceId,
                                    int groupId,
                                    int aggregationId,
                                    CountMinSketchSpec specification)

getCriteriaKeyBinding

java.lang.Object getCriteriaKeyBinding(ExprEvaluator[] evaluators)

getGroupKeyBinding

java.lang.Object getGroupKeyBinding(ExprNode[] groupKeyExpressions,
                                    AggregationGroupByRollupDesc groupByRollupDesc)

getGroupKeyBinding

java.lang.Object getGroupKeyBinding(AggregationLocalGroupByPlan localGroupByPlan)

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com