com.espertech.esper.filter
Interface FilterService

All Known Subinterfaces:
FilterServiceSPI
All Known Implementing Classes:
FilterServiceBase, FilterServiceLockCoarse, FilterServiceLockFine

public interface FilterService

Interface for filtering events by event type and event property values. Allows adding and removing filters.

Filters are defined by a FilterSpecCompiled and are associated with a FilterHandle callback. Implementations may decide if the same filter callback can be registered twice for different or some filter specifications.

The performance of an implementation of this service is crucial in achieving a high overall event throughput.


Method Summary
 void add(FilterValueSet filterValueSet, FilterHandle callback)
          Add a filter for events as defined by the filter specification, and register a callback to be invoked upon evaluation of an event that matches the filter spec.
 void destroy()
          Destroy the service.
 long evaluate(EventBean theEvent, java.util.Collection<FilterHandle> matches)
          Finds matching filters to the event passed in and collects their associated callback method.
 long evaluate(EventBean theEvent, java.util.Collection<FilterHandle> matches, java.lang.String statementId)
          Finds matching filters to the event passed in and collects their associated callback method, for a particular statement only
 long getFiltersVersion()
          Returns filter version.
 long getNumEventsEvaluated()
          Return a count of the number of events evaluated by this service.
 void remove(FilterHandle callback)
          Remove a filter callback.
 void removeType(EventType type)
           
 void resetStats()
          Reset the number of events evaluated
 

Method Detail

evaluate

long evaluate(EventBean theEvent,
              java.util.Collection<FilterHandle> matches)
Finds matching filters to the event passed in and collects their associated callback method.

Parameters:
theEvent - is the event to be matched against filters
matches - is a collection that is populated via add method with any handles for matching filters
Returns:
filter current version

evaluate

long evaluate(EventBean theEvent,
              java.util.Collection<FilterHandle> matches,
              java.lang.String statementId)
Finds matching filters to the event passed in and collects their associated callback method, for a particular statement only

Parameters:
theEvent - is the event to be matched against filters
matches - is a collection that is populated via add method with any handles for matching filters
statementId - statement for which to return results for
Returns:
filter current version

add

void add(FilterValueSet filterValueSet,
         FilterHandle callback)
Add a filter for events as defined by the filter specification, and register a callback to be invoked upon evaluation of an event that matches the filter spec.

Parameters:
filterValueSet - is a specification of filter parameters, contains event type information, event property values and operators
callback - is the callback to be invoked when the filter matches an event

remove

void remove(FilterHandle callback)
Remove a filter callback.

Parameters:
callback - is the callback to be removed

getNumEventsEvaluated

long getNumEventsEvaluated()
Return a count of the number of events evaluated by this service.

Returns:
count of invocations of evaluate method

resetStats

void resetStats()
Reset the number of events evaluated


destroy

void destroy()
Destroy the service.


getFiltersVersion

long getFiltersVersion()
Returns filter version.

Returns:
filter version

removeType

void removeType(EventType type)

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