net.esper.core
Class EPStatementHandle

java.lang.Object
  extended by net.esper.core.EPStatementHandle
All Implemented Interfaces:
Serializable, MetaDefItem

public class EPStatementHandle
extends Object
implements MetaDefItem

Class exists once per statement and hold statement resource lock(s).

Use by EPRuntimeImpl for determining callback-statement affinity and locking of statement resources.

See Also:
Serialized Form

Constructor Summary
EPStatementHandle(String statementId, ManagedLock statementLock, String expressionText)
          Ctor.
 
Method Summary
 boolean equals(Object otherObj)
           
 ManagedLock getRoutedInsertStreamLock()
          Returns the insert-into stream lock to use for reserving order in generated streams.
 ManagedLock getStatementLock()
          Returns statement resource lock.
 int hashCode()
           
 void internalDispatch()
          Invoked by EPRuntime to indicate that a statements's filer and schedule processing is done, and now it's time to process join results.
 boolean isCanSelfJoin()
          Returns true if the statement potentially self-joins amojng the events it processes.
 void setCanSelfJoin(boolean canSelfJoin)
          Set the statement's self-join flag to indicate the the statement may join to itself, that is a single event may dispatch into multiple streams or patterns for the same statement, requiring internal dispatch logic to not shortcut evaluation of all filters for the statement within one lock, requiring the callback handle to be sorted.
 void setOptionalDispatchable(EPStatementDispatch optionalDispatchable)
          Provides a callback for use when statement processing for filters and schedules is done, for use by join statements that require an explicit indicator that all joined streams results have been processed.
 void setRoutedInsertStreamLock(ManagedLock routedInsertStreamLock)
          Set a insert-into stream lock to use for reserving order in generated streams.
 void setStatementLock(ManagedLock statementLock)
          Sets the lock to use for the statement.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPStatementHandle

public EPStatementHandle(String statementId,
                         ManagedLock statementLock,
                         String expressionText)
Ctor.

Parameters:
statementId - is the statement id uniquely indentifying the handle
statementLock - is the statement resource lock
expressionText - is the expression
Method Detail

setCanSelfJoin

public void setCanSelfJoin(boolean canSelfJoin)
Set the statement's self-join flag to indicate the the statement may join to itself, that is a single event may dispatch into multiple streams or patterns for the same statement, requiring internal dispatch logic to not shortcut evaluation of all filters for the statement within one lock, requiring the callback handle to be sorted.

Parameters:
canSelfJoin - is true if the statement potentially self-joins, false if not

setRoutedInsertStreamLock

public void setRoutedInsertStreamLock(ManagedLock routedInsertStreamLock)
Set a insert-into stream lock to use for reserving order in generated streams.

Parameters:
routedInsertStreamLock - is a lock to use to lock the stream when routing events into it

getRoutedInsertStreamLock

public ManagedLock getRoutedInsertStreamLock()
Returns the insert-into stream lock to use for reserving order in generated streams.

Returns:
lock

getStatementLock

public ManagedLock getStatementLock()
Returns statement resource lock.

Returns:
lock

setStatementLock

public void setStatementLock(ManagedLock statementLock)
Sets the lock to use for the statement.

Parameters:
statementLock - statement lock

setOptionalDispatchable

public void setOptionalDispatchable(EPStatementDispatch optionalDispatchable)
Provides a callback for use when statement processing for filters and schedules is done, for use by join statements that require an explicit indicator that all joined streams results have been processed.

Parameters:
optionalDispatchable - is the instance for calling onto after statement callback processing

internalDispatch

public void internalDispatch()
Invoked by EPRuntime to indicate that a statements's filer and schedule processing is done, and now it's time to process join results.


equals

public boolean equals(Object otherObj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isCanSelfJoin

public boolean isCanSelfJoin()
Returns true if the statement potentially self-joins amojng the events it processes.

Returns:
true for self-joins possible, false for not possible (most statements)