public class EventTypeIndex extends Object implements EventEvaluator
FilterParamIndexBase
and filter callbacks in FilterHandleSetNode
.
This class evaluates events for the purpose of filtering by (1) looking up the event's EventType
and (2) asking the subtree for this event type to evaluate the event.
The class performs all the locking required for multithreaded access.
Constructor and Description |
---|
EventTypeIndex(FilterServiceGranularLockFactory lockFactory) |
Modifier and Type | Method and Description |
---|---|
void |
add(com.espertech.esper.common.client.EventType eventType,
FilterHandleSetNode rootNode)
Add a new event type to the index and use the specified node for the root node of its subtree.
|
void |
destroy()
Destroy the service.
|
FilterHandleSetNode |
get(com.espertech.esper.common.client.EventType eventType)
Returns the root node for the given event type, or null if this event type has not been seen before.
|
protected int |
getFilterCountApprox() |
void |
getTraverseStatement(EventTypeIndexTraverse traverse,
Set<Integer> statementIds,
ArrayDeque<FilterItem> evaluatorStack) |
Map<com.espertech.esper.common.client.meta.EventTypeIdPair,Map<Integer,List<FilterItem[]>>> |
getTraverseStatement(Set<Integer> statementIds) |
void |
matchEvent(com.espertech.esper.common.client.EventBean theEvent,
Collection<com.espertech.esper.common.internal.filtersvc.FilterHandle> matches,
com.espertech.esper.common.internal.epl.expression.core.ExprEvaluatorContext ctx)
Perform the matching of an event based on the event property values,
adding any callbacks for matches found to the matches list.
|
void |
removeType(com.espertech.esper.common.client.EventType type) |
protected int |
size()
Returns the current size of the known event types.
|
public EventTypeIndex(FilterServiceGranularLockFactory lockFactory)
public void destroy()
public Map<com.espertech.esper.common.client.meta.EventTypeIdPair,Map<Integer,List<FilterItem[]>>> getTraverseStatement(Set<Integer> statementIds)
public void getTraverseStatement(EventTypeIndexTraverse traverse, Set<Integer> statementIds, ArrayDeque<FilterItem> evaluatorStack)
getTraverseStatement
in interface EventEvaluator
public void add(com.espertech.esper.common.client.EventType eventType, FilterHandleSetNode rootNode)
eventType
- is the event type to be added to the indexrootNode
- is the root node of the subtree for filter constant indizes and callbackspublic void removeType(com.espertech.esper.common.client.EventType type)
public FilterHandleSetNode get(com.espertech.esper.common.client.EventType eventType)
eventType
- is an event typepublic void matchEvent(com.espertech.esper.common.client.EventBean theEvent, Collection<com.espertech.esper.common.internal.filtersvc.FilterHandle> matches, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluatorContext ctx)
EventEvaluator
matchEvent
in interface EventEvaluator
theEvent
- is the event object wrapper to obtain event property values frommatches
- accumulates the matching filter callbacksctx
- evaluator contextprotected int size()
protected int getFilterCountApprox()
Copyright © 2005–2022. All rights reserved.