com.espertech.esper.epl.named
Interface NamedWindowService

All Known Implementing Classes:
NamedWindowServiceImpl

public interface NamedWindowService

Service to manage named window dispatches, locks and processors on an engine level.


Field Summary
static java.lang.String ERROR_MSG_DATAWINDOWS
          Error message for data windows required.
static java.lang.String ERROR_MSG_NO_DATAWINDOW_ALLOWED
          Error message for no data window allowed.
 
Method Summary
 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()
          Dispatch events of the insert and remove stream of named windows to consumers, as part of the main event processing or dispatch loop.
 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.
 

Field Detail

ERROR_MSG_DATAWINDOWS

static final java.lang.String ERROR_MSG_DATAWINDOWS
Error message for data windows required.

See Also:
Constant Field Values

ERROR_MSG_NO_DATAWINDOW_ALLOWED

static final java.lang.String ERROR_MSG_NO_DATAWINDOW_ALLOWED
Error message for no data window allowed.

See Also:
Constant Field Values
Method Detail

isNamedWindow

boolean isNamedWindow(java.lang.String name)
Returns true to indicate that the name is a named window.

Parameters:
name - is the window name
Returns:
true if a named window, false if not a named window

getNamedWindows

java.lang.String[] getNamedWindows()
Returns the names of all named windows known.

Returns:
named window names

addProcessor

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
Create a new named window.

Parameters:
name - window name
eventType - the event type of the window
statementResultService - for coordinating on whether insert and remove stream events should be posted
revisionProcessor - handles update events
eplExpression - is the expression
statementName - the name of the statement
isPrioritized - if the engine is running with prioritized execution
Returns:
processor for the named window
Throws:
ViewProcessingException - if the named window already exists

getProcessor

NamedWindowProcessor getProcessor(java.lang.String name)
Returns the processing instance for a given named window.

Parameters:
name - window name
Returns:
processor for the named window

removeProcessor

void removeProcessor(java.lang.String name)
Upon destroy of the named window creation statement, the named window processor must be removed.

Parameters:
name - is the named window name

dispatch

boolean dispatch()
Dispatch events of the insert and remove stream of named windows to consumers, as part of the main event processing or dispatch loop.

Returns:
send events to consuming statements

addDispatch

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.

Parameters:
delta - is the result to dispatch
consumers - is the destination of the dispatch, a map of statements to one or more consuming views

getNamedWindowLock

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.

Parameters:
windowName - is the window name
Returns:
the lock for the named window, or null if the window dos not yet exists

addNamedWindowLock

void addNamedWindowLock(java.lang.String windowName,
                        StatementAgentInstanceLock statementResourceLock,
                        java.lang.String statementName)
Sets the lock to use for a named window.

Parameters:
windowName - is the named window name
statementResourceLock - is the statement lock for the create window statement
statementName - the name of the statement that is the "create window"

removeNamedWindowLock

void removeNamedWindowLock(java.lang.String statementName)
Remove the lock associated to the named window.

Parameters:
statementName - the name of the statement that is the "create window"

destroy

void destroy()
Clear out the service.


addObserver

void addObserver(NamedWindowLifecycleObserver observer)
Add an observer to be called back when named window state changes occur.

Observers have set-semantics: the same Observer cannot be added twice

Parameters:
observer - to add

removeObserver

void removeObserver(NamedWindowLifecycleObserver observer)
Remove an observer to be called back when named window state changes occur.

Parameters:
observer - to remove

getNamedWindowIndexes

IndexMultiKey[] getNamedWindowIndexes(java.lang.String windowName)
Returns an index descriptor array describing all available indexes for the named window.

Parameters:
windowName - window name
Returns:
indexes

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