com.espertech.esper.view.stream
Interface StreamFactoryService

All Known Implementing Classes:
StreamFactorySvcImpl

public interface StreamFactoryService

Service on top of the filter service for reuseing filter callbacks and their associated EventStream instances. Same filter specifications (equal) do not need to be added to the filter service twice and the EventStream instance that is the stream of events for that filter can be reused.

We are re-using streams such that views under such streams can be reused for efficient resource use.


Method Summary
 Pair<EventStream,StatementAgentInstanceLock> createStream(java.lang.String statementId, FilterSpecCompiled filterSpec, FilterService filterService, EPStatementAgentInstanceHandle epStatementAgentInstanceHandle, boolean isJoin, ExprEvaluatorContext exprEvaluatorContext, boolean hasOrderBy, boolean filterWithSameTypeSubselect, java.lang.annotation.Annotation[] annotations, boolean stateless, int streamNum, boolean isCanIterateUnbound)
          Create or reuse existing EventStream instance representing that event filter.
 void destroy()
          Destroy the service.
 void dropStream(FilterSpecCompiled filterSpec, FilterService filterService, boolean isJoin, boolean hasOrderBy, boolean filterWithSameTypeSubselect, boolean stateless)
          Drop the event stream associated with the filter passed in.
 

Method Detail

createStream

Pair<EventStream,StatementAgentInstanceLock> createStream(java.lang.String statementId,
                                                          FilterSpecCompiled filterSpec,
                                                          FilterService filterService,
                                                          EPStatementAgentInstanceHandle epStatementAgentInstanceHandle,
                                                          boolean isJoin,
                                                          ExprEvaluatorContext exprEvaluatorContext,
                                                          boolean hasOrderBy,
                                                          boolean filterWithSameTypeSubselect,
                                                          java.lang.annotation.Annotation[] annotations,
                                                          boolean stateless,
                                                          int streamNum,
                                                          boolean isCanIterateUnbound)
Create or reuse existing EventStream instance representing that event filter. When called for some filters, should return same stream.

Parameters:
statementId - the statement id
filterSpec - event filter definition
filterService - filter service to activate filter if not already active
epStatementAgentInstanceHandle - is the statements-own handle for use in registering callbacks with services
isJoin - is indicatng whether the stream will participate in a join statement, information necessary for stream reuse and multithreading concerns
exprEvaluatorContext - expression evaluation context
hasOrderBy - if the consumer has order-by
Returns:
event stream representing active filter

dropStream

void dropStream(FilterSpecCompiled filterSpec,
                FilterService filterService,
                boolean isJoin,
                boolean hasOrderBy,
                boolean filterWithSameTypeSubselect,
                boolean stateless)
Drop the event stream associated with the filter passed in. Throws an exception if already dropped.

Parameters:
filterSpec - is the event filter definition associated with the event stream to be dropped
filterService - to be used to deactivate filter when the last event stream is dropped
isJoin - is indicatng whether the stream will participate in a join statement, information necessary for stream reuse and multithreading concerns
hasOrderBy - if the consumer has an order-by clause

destroy

void destroy()
Destroy the service.


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