public class StatementResultServiceImpl extends Object implements StatementResultService
Modifier and Type | Field and Description |
---|---|
protected ThreadLocal<ArrayDeque<UniformPair<EventBean[]>>> |
lastResults
Buffer for holding dispatchable events.
|
Constructor and Description |
---|
StatementResultServiceImpl(String statementName,
StatementLifecycleSvc statementLifecycleSvc,
MetricReportingServiceSPI metricReportingService,
ThreadingService threadingService)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispatchOnStop()
Dispatches when the statement is stopped any remaining results.
|
void |
execute()
Execution of result indication.
|
int |
getStatementId() |
EPStatementListenerSet |
getStatementListenerSet() |
String |
getStatementName() |
void |
indicate(UniformPair<EventBean[]> results)
Stores for dispatching the statement results.
|
boolean |
isMakeNatural()
Returns true to indicate that natural events should be produced, for
use in select expression processing.
|
boolean |
isMakeSynthetic()
Returns true to indicate that synthetic events should be produced, for
use in select expression processing.
|
void |
processDispatch(UniformPair<EventBean[]> events)
Indicate an outbound result.
|
void |
setContext(EPStatementSPI epStatement,
EPServiceProviderSPI epServiceProvider,
boolean isInsertInto,
boolean isPattern,
boolean isDistinct,
boolean isForClause,
StatementMetricHandle statementMetricHandle)
For initialization of the service to provide statement context.
|
void |
setSelectClause(Class[] selectClauseTypes,
String[] selectClauseColumnNames,
boolean forClauseDelivery,
ExprEvaluator[] groupDeliveryExpressions,
ExprEvaluatorContext exprEvaluatorContext)
For initialize of the service providing select clause column types and names.
|
void |
setUpdateListeners(EPStatementListenerSet updateListeners,
boolean isRecovery)
Indicate a change in update listener.
|
protected ThreadLocal<ArrayDeque<UniformPair<EventBean[]>>> lastResults
public StatementResultServiceImpl(String statementName, StatementLifecycleSvc statementLifecycleSvc, MetricReportingServiceSPI metricReportingService, ThreadingService threadingService)
statementLifecycleSvc
- handles persistence for statementsmetricReportingService
- for metrics reportingthreadingService
- for outbound threadingstatementName
- statement namepublic void setContext(EPStatementSPI epStatement, EPServiceProviderSPI epServiceProvider, boolean isInsertInto, boolean isPattern, boolean isDistinct, boolean isForClause, StatementMetricHandle statementMetricHandle)
StatementResultService
setContext
in interface StatementResultService
epStatement
- the statementepServiceProvider
- the engine instanceisInsertInto
- true if this is insert intoisPattern
- true if this is a pattern statementisDistinct
- true if using distinctisForClause
- indicator that for-clause existsstatementMetricHandle
- handle for metrics reportingpublic void setSelectClause(Class[] selectClauseTypes, String[] selectClauseColumnNames, boolean forClauseDelivery, ExprEvaluator[] groupDeliveryExpressions, ExprEvaluatorContext exprEvaluatorContext)
StatementResultService
setSelectClause
in interface StatementResultService
selectClauseTypes
- types of columns in the select clauseselectClauseColumnNames
- column namesforClauseDelivery
- for-clausegroupDeliveryExpressions
- grouped-deliveryexprEvaluatorContext
- contextpublic int getStatementId()
getStatementId
in interface StatementResultService
public boolean isMakeSynthetic()
StatementResultService
isMakeSynthetic
in interface StatementResultService
public boolean isMakeNatural()
StatementResultService
isMakeNatural
in interface StatementResultService
public String getStatementName()
getStatementName
in interface StatementResultService
public EPStatementListenerSet getStatementListenerSet()
getStatementListenerSet
in interface StatementResultService
public void setUpdateListeners(EPStatementListenerSet updateListeners, boolean isRecovery)
StatementResultService
setUpdateListeners
in interface StatementResultService
updateListeners
- is the new listeners and subscriberisRecovery
- indicator whether recoveringpublic void indicate(UniformPair<EventBean[]> results)
StatementResultService
indicate
in interface StatementResultService
results
- is the insert and remove stream datapublic void execute()
StatementResultService
execute
in interface StatementResultService
public void processDispatch(UniformPair<EventBean[]> events)
events
- to indicatepublic void dispatchOnStop()
dispatchOnStop
in interface StatementResultService