com.espertech.esper.filter
Class FilterSpecCompiler

java.lang.Object
  extended by com.espertech.esper.filter.FilterSpecCompiler

public final class FilterSpecCompiler
extends java.lang.Object

Helper to compile (validate and optimize) filter expressions as used in pattern and filter-based streams.


Field Summary
static java.lang.String PROPERTY_NAME_BOOLEAN_EXPRESSION
          Assigned for filter parameters that are based on boolean expression and not on any particular property name.
 
Constructor Summary
FilterSpecCompiler()
           
 
Method Summary
static FilterSpecCompiled build(java.util.List<ExprNode> validatedNodes, EventType eventType, java.lang.String eventTypeName, PropertyEvalSpec optionalPropertyEvalSpec, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes, StreamTypeService streamTypeService, java.lang.String optionalStreamName, StatementContext stmtContext, java.util.Collection<java.lang.Integer> assignedTypeNumberStack)
           
static FilterSpecCompiled buildNoStmtCtx(java.util.List<ExprNode> validatedFilterNodes, EventType eventType, java.lang.String eventTypeName, PropertyEvalSpec optionalPropertyEvalSpec, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes, StreamTypeService streamTypeService, java.lang.String optionalStreamName, java.util.Collection<java.lang.Integer> assignedTypeNumberStack, ExprEvaluatorContext exprEvaluatorContext, java.lang.String statementId, java.lang.String statementName, java.lang.annotation.Annotation[] annotations, ContextDescriptor contextDescriptor, MethodResolutionService methodResolutionService, EventAdapterService eventAdapterService, TimeProvider timeProvider, VariableService variableService, TableService tableService, ConfigurationInformation configurationInformation, NamedWindowService namedWindowService)
           
static FilterSpecCompiled makeFilterSpec(EventType eventType, java.lang.String eventTypeName, java.util.List<ExprNode> filterExpessions, PropertyEvalSpec optionalPropertyEvalSpec, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes, StreamTypeService streamTypeService, java.lang.String optionalStreamName, StatementContext statementContext, java.util.Collection<java.lang.Integer> assignedTypeNumberStack)
          Factory method for compiling filter expressions into a filter specification for use with filter service.
static java.util.List<ExprNode> validateAllowSubquery(ExprNodeOrigin exprNodeOrigin, java.util.List<ExprNode> exprNodes, StreamTypeService streamTypeService, StatementContext statementContext, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes, java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes)
          Validates expression nodes and returns a list of validated nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_NAME_BOOLEAN_EXPRESSION

public static final java.lang.String PROPERTY_NAME_BOOLEAN_EXPRESSION
Assigned for filter parameters that are based on boolean expression and not on any particular property name.

Keeping this artificial property name is a simplification as optimized filter parameters generally keep a property name.

See Also:
Constant Field Values
Constructor Detail

FilterSpecCompiler

public FilterSpecCompiler()
Method Detail

makeFilterSpec

public static FilterSpecCompiled makeFilterSpec(EventType eventType,
                                                java.lang.String eventTypeName,
                                                java.util.List<ExprNode> filterExpessions,
                                                PropertyEvalSpec optionalPropertyEvalSpec,
                                                java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes,
                                                java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes,
                                                StreamTypeService streamTypeService,
                                                java.lang.String optionalStreamName,
                                                StatementContext statementContext,
                                                java.util.Collection<java.lang.Integer> assignedTypeNumberStack)
                                         throws ExprValidationException
Factory method for compiling filter expressions into a filter specification for use with filter service.

Parameters:
eventType - is the filtered-out event type
eventTypeName - is the name of the event type
filterExpessions - is a list of filter expressions
taggedEventTypes - is a map of stream names (tags) and event types available
arrayEventTypes - is a map of name tags and event type per tag for repeat-expressions that generate an array of events
streamTypeService - is used to set rules for resolving properties
optionalStreamName - - the stream name, if provided
optionalPropertyEvalSpec - - specification for evaluating properties
statementContext - context for statement
Returns:
compiled filter specification
Throws:
ExprValidationException - if the expression or type validations failed

build

public static FilterSpecCompiled build(java.util.List<ExprNode> validatedNodes,
                                       EventType eventType,
                                       java.lang.String eventTypeName,
                                       PropertyEvalSpec optionalPropertyEvalSpec,
                                       java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes,
                                       java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes,
                                       StreamTypeService streamTypeService,
                                       java.lang.String optionalStreamName,
                                       StatementContext stmtContext,
                                       java.util.Collection<java.lang.Integer> assignedTypeNumberStack)
                                throws ExprValidationException
Throws:
ExprValidationException

buildNoStmtCtx

public static FilterSpecCompiled buildNoStmtCtx(java.util.List<ExprNode> validatedFilterNodes,
                                                EventType eventType,
                                                java.lang.String eventTypeName,
                                                PropertyEvalSpec optionalPropertyEvalSpec,
                                                java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes,
                                                java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes,
                                                StreamTypeService streamTypeService,
                                                java.lang.String optionalStreamName,
                                                java.util.Collection<java.lang.Integer> assignedTypeNumberStack,
                                                ExprEvaluatorContext exprEvaluatorContext,
                                                java.lang.String statementId,
                                                java.lang.String statementName,
                                                java.lang.annotation.Annotation[] annotations,
                                                ContextDescriptor contextDescriptor,
                                                MethodResolutionService methodResolutionService,
                                                EventAdapterService eventAdapterService,
                                                TimeProvider timeProvider,
                                                VariableService variableService,
                                                TableService tableService,
                                                ConfigurationInformation configurationInformation,
                                                NamedWindowService namedWindowService)
                                         throws ExprValidationException
Throws:
ExprValidationException

validateAllowSubquery

public static java.util.List<ExprNode> validateAllowSubquery(ExprNodeOrigin exprNodeOrigin,
                                                             java.util.List<ExprNode> exprNodes,
                                                             StreamTypeService streamTypeService,
                                                             StatementContext statementContext,
                                                             java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> taggedEventTypes,
                                                             java.util.LinkedHashMap<java.lang.String,Pair<EventType,java.lang.String>> arrayEventTypes)
                                                      throws ExprValidationException
Validates expression nodes and returns a list of validated nodes.

Parameters:
exprNodes - is the nodes to validate
streamTypeService - is provding type information for each stream
taggedEventTypes - pattern tagged types
arrayEventTypes - @return list of validated expression nodes
statementContext - context
Returns:
expr nodes
Throws:
ExprValidationException - for validation errors

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