|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.esper.view.stream.StreamFactorySvcImpl
public class StreamFactorySvcImpl
Service implementation to reuse or not reuse event streams and existing filters depending on the type of statement.
For non-join statements, the class manages the reuse of event streams when filters match, and thus when an event stream is reused such can be the views under the stream. For joins however, this can lead to problems in multithread-safety since the statement resource lock would then have to be multiple locks, i.e. the reused statement's resource lock and the join statement's own lock, at a minimum.
For join statements, always creating a new event stream and therefore not reusing view resources, for use with joins.
This can be very effective in that if a client applications creates a large number of very similar statements in terms of filters and views used then these resources are all re-used across statements.
The re-use is multithread-safe in that (A) statement start/stop is locked against other engine processing (B) the first statement supplies the lock for shared filters and views, protecting multiple threads from entering into the same view. (C) joins statements do not participate in filter and view reuse
Constructor Summary | |
---|---|
StreamFactorySvcImpl(boolean isReuseViews)
Ctor. |
Method Summary | |
---|---|
Pair<EventStream,ManagedLock> |
createStream(FilterSpecCompiled filterSpec,
FilterService filterService,
EPStatementHandle epStatementHandle,
boolean isJoin)
See the method of the same name in StreamFactoryService . |
void |
dropStream(FilterSpecCompiled filterSpec,
FilterService filterService,
boolean isJoin)
See the method of the same name in StreamFactoryService . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamFactorySvcImpl(boolean isReuseViews)
isReuseViews
- indicator on whether stream and view resources are to be reused between statementsMethod Detail |
---|
public Pair<EventStream,ManagedLock> createStream(FilterSpecCompiled filterSpec, FilterService filterService, EPStatementHandle epStatementHandle, boolean isJoin)
StreamFactoryService
. Always attempts to reuse an existing event stream.
May thus return a new event stream or an existing event stream depending on whether filter criteria match.
createStream
in interface StreamFactoryService
filterSpec
- is the filter definitionepStatementHandle
- is the statement resource lockfilterService
- filter service to activate filter if not already activeisJoin
- is indicatng whether the stream will participate in a join statement, information
necessary for stream reuse and multithreading concerns
public void dropStream(FilterSpecCompiled filterSpec, FilterService filterService, boolean isJoin)
StreamFactoryService
.
dropStream
in interface StreamFactoryService
filterSpec
- is the filter definitionfilterService
- to be used to deactivate filter when the last event stream is droppedisJoin
- is indicatng whether the stream will participate in a join statement, information
necessary for stream reuse and multithreading concerns
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |