public class NamedWindowServiceImpl extends java.lang.Object implements NamedWindowService
ERROR_MSG_DATAWINDOWS, ERROR_MSG_NO_DATAWINDOW_ALLOWED
Constructor and Description |
---|
NamedWindowServiceImpl(SchedulingService schedulingService,
StatementLockFactory statementLockFactory,
VariableService variableService,
boolean isPrioritized,
ManagedReadWriteLock eventProcessingRWLock,
ExceptionHandlingService exceptionHandlingService,
boolean enableQueryPlanLog,
MetricReportingService metricReportingService)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDispatch(NamedWindowDeltaData delta,
java.util.Map<EPStatementAgentInstanceHandle,java.util.List<NamedWindowConsumerView>> consumers)
For use to add a result of a named window that must be dispatched to consuming views.
|
void |
addNamedWindowLock(java.lang.String windowName,
StatementAgentInstanceLock statementResourceLock,
java.lang.String statementName)
Sets the lock to use for a named window.
|
void |
addObserver(NamedWindowLifecycleObserver observer)
Add an observer to be called back when named window state changes occur.
|
NamedWindowProcessor |
addProcessor(java.lang.String name,
java.lang.String contextName,
boolean singleInstanceContext,
EventType eventType,
StatementResultService statementResultService,
ValueAddEventProcessor revisionProcessor,
java.lang.String eplExpression,
java.lang.String statementName,
boolean isPrioritized,
boolean isEnableSubqueryIndexShare,
boolean isBatchingDataWindow,
boolean isVirtualDataWindow,
StatementMetricHandle statementMetricHandle,
java.util.Set<java.lang.String> optionalUniqueKeyProps,
java.lang.String eventTypeAsName)
Create a new named window.
|
void |
destroy()
Clear out the service.
|
boolean |
dispatch(ExprEvaluatorContext exprEvaluatorContext)
Dispatch events of the insert and remove stream of named windows to consumers, as part of the
main event processing or dispatch loop.
|
java.util.LinkedHashMap<NamedWindowConsumerView,NamedWindowDeltaData> |
getDeltaPerConsumer(java.lang.Object perStmtObj,
EPStatementAgentInstanceHandle handle) |
IndexMultiKey[] |
getNamedWindowIndexes(java.lang.String windowName)
Returns an index descriptor array describing all available indexes for the named window.
|
StatementAgentInstanceLock |
getNamedWindowLock(java.lang.String windowName)
Returns the statement lock for the named window, to be shared with on-delete statements for the same named window.
|
java.lang.String[] |
getNamedWindows()
Returns the names of all named windows known.
|
NamedWindowProcessor |
getProcessor(java.lang.String name)
Returns the processing instance for a given named window.
|
boolean |
isNamedWindow(java.lang.String name)
Returns true to indicate that the name is a named window.
|
void |
removeNamedWindowLock(java.lang.String statementName)
Remove the lock associated to the named window.
|
void |
removeObserver(NamedWindowLifecycleObserver observer)
Remove an observer to be called back when named window state changes occur.
|
void |
removeProcessor(java.lang.String name)
Upon destroy of the named window creation statement, the named window processor must be removed.
|
public NamedWindowServiceImpl(SchedulingService schedulingService, StatementLockFactory statementLockFactory, VariableService variableService, boolean isPrioritized, ManagedReadWriteLock eventProcessingRWLock, ExceptionHandlingService exceptionHandlingService, boolean enableQueryPlanLog, MetricReportingService metricReportingService)
statementLockFactory
- statement lock factoryvariableService
- is for variable accessisPrioritized
- if the engine is running with prioritized executionpublic void destroy()
NamedWindowService
destroy
in interface NamedWindowService
public java.lang.String[] getNamedWindows()
NamedWindowService
getNamedWindows
in interface NamedWindowService
public StatementAgentInstanceLock getNamedWindowLock(java.lang.String windowName)
NamedWindowService
getNamedWindowLock
in interface NamedWindowService
windowName
- is the window namepublic void addNamedWindowLock(java.lang.String windowName, StatementAgentInstanceLock statementResourceLock, java.lang.String statementName)
NamedWindowService
addNamedWindowLock
in interface NamedWindowService
windowName
- is the named window namestatementResourceLock
- is the statement lock for the create window statementstatementName
- the name of the statement that is the "create window"public void removeNamedWindowLock(java.lang.String statementName)
NamedWindowService
removeNamedWindowLock
in interface NamedWindowService
statementName
- the name of the statement that is the "create window"public boolean isNamedWindow(java.lang.String name)
NamedWindowService
isNamedWindow
in interface NamedWindowService
name
- is the window namepublic NamedWindowProcessor getProcessor(java.lang.String name)
NamedWindowService
getProcessor
in interface NamedWindowService
name
- window namepublic IndexMultiKey[] getNamedWindowIndexes(java.lang.String windowName)
NamedWindowService
getNamedWindowIndexes
in interface NamedWindowService
windowName
- window namepublic NamedWindowProcessor addProcessor(java.lang.String name, java.lang.String contextName, boolean singleInstanceContext, EventType eventType, StatementResultService statementResultService, ValueAddEventProcessor revisionProcessor, java.lang.String eplExpression, java.lang.String statementName, boolean isPrioritized, boolean isEnableSubqueryIndexShare, boolean isBatchingDataWindow, boolean isVirtualDataWindow, StatementMetricHandle statementMetricHandle, java.util.Set<java.lang.String> optionalUniqueKeyProps, java.lang.String eventTypeAsName) throws ViewProcessingException
NamedWindowService
addProcessor
in interface NamedWindowService
name
- window nameeventType
- the event type of the windowstatementResultService
- for coordinating on whether insert and remove stream events should be postedrevisionProcessor
- handles update eventseplExpression
- is the expressionstatementName
- the name of the statementisPrioritized
- if the engine is running with prioritized executionViewProcessingException
- if the named window already existspublic void removeProcessor(java.lang.String name)
NamedWindowService
removeProcessor
in interface NamedWindowService
name
- is the named window namepublic void addDispatch(NamedWindowDeltaData delta, java.util.Map<EPStatementAgentInstanceHandle,java.util.List<NamedWindowConsumerView>> consumers)
NamedWindowService
addDispatch
in interface NamedWindowService
delta
- is the result to dispatchconsumers
- is the destination of the dispatch, a map of statements to one or more consuming viewspublic boolean dispatch(ExprEvaluatorContext exprEvaluatorContext)
NamedWindowService
dispatch
in interface NamedWindowService
exprEvaluatorContext
- context for expression evalauationpublic void addObserver(NamedWindowLifecycleObserver observer)
NamedWindowService
Observers have set-semantics: the same Observer cannot be added twice
addObserver
in interface NamedWindowService
observer
- to addpublic void removeObserver(NamedWindowLifecycleObserver observer)
NamedWindowService
removeObserver
in interface NamedWindowService
observer
- to removepublic java.util.LinkedHashMap<NamedWindowConsumerView,NamedWindowDeltaData> getDeltaPerConsumer(java.lang.Object perStmtObj, EPStatementAgentInstanceHandle handle)