public class CEPEsperProcessor extends Module implements DataReceiver, DataEmitter, CEPEsperProcessorMXBean
Map and Node data types are supplied to the esper
runtime so that esper specific interpretation is possible. All maps
are supplied to the runtime with the type name map.
When requesting data, either an EPL or a Pattern query has to be specified. The results of the query are emitted to the next module in the data flow.
Multiple queries can be submitted when creating a data flow. When multiple queries are submitted, only the results of the last query are emitted to the next stage in the data flow.
Any errors in the query syntax will result in an error when setting up the data flow, except when the module is configured to use external time.
If the module is configured to use external time, errors in query
syntax are not reported until after the module has received data
that implements TimestampCarrier. Errors in query will
result in the data flow being cancelled.
When configured to use external time, the module creates the
query statements after it receives the first TimestampCarrier.
Any non-TimestampCarrier received prior to that are
reported and ignored.
Module Features
| Capabilities | Data Emitter, Data Receiver |
|---|---|
| DataFlow Request Parameters | String: CEP query; String[]: Multiple CEP queries |
| Stops data flows | If it encounters an error when creating statements in external time mode. |
| Start Operation | Initializes Esper Runtime |
| Stop Operation | Destroys Esper Runtime |
| Management Interface | CEPEsperProcessorMXBean |
| Factory | CEPEsperFactory |
| Modifier and Type | Class and Description |
|---|---|
static class |
CEPEsperProcessor.Subscriber
A Subscriber class that subscribes to the query statement results
and emits them out to the flow that requested that statement.
|
| Modifier | Constructor and Description |
|---|---|
protected |
CEPEsperProcessor(ModuleURN inURN)
Creates an instance.
|
protected |
CEPEsperProcessor(ModuleURN inURN,
boolean inAutoStart) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(DataFlowID inFlowID,
RequestID inRequestID) |
protected ArrayList<com.espertech.esper.client.EPStatement> |
createStatements(String... inQuery)
Submits the supplied queries to the runtime and returns the statement
objects representing each one of those queries.
|
String |
getConfiguration()
Specifies the location of the configuration file for the module.
|
long |
getNumEventsReceived()
Returns the number of events received over the lifetime of the
event stream processing runtime.
|
String[] |
getStatementNames()
Returns the names of all the statements currently being handled
by the runtime.
|
boolean |
isUseExternalTime()
If the runtime should use external time source.
|
protected void |
preStart() |
protected void |
preStop() |
void |
receiveData(DataFlowID inFlowID,
Object inData)
Need to keep a reference count in case of nested events being sent out of Esper and posted back in
Increment the count before, and then decrement after
|
void |
requestData(DataRequest inRequest,
DataEmitterSupport inSupport) |
void |
setConfiguration(String inConfiguration)
Specifies the location of the configuration file for the module.
|
void |
setUseExternalTime(boolean inUseExternalTime)
If the runtime should use external time source.
|
getCreated, getLastStartFailure, getLastStopFailure, getStarted, getState, getStopped, getURN, isAutoCreated, isAutoStartprotected CEPEsperProcessor(ModuleURN inURN, boolean inAutoStart)
protected CEPEsperProcessor(ModuleURN inURN)
inURN - the module URN.public void requestData(DataRequest inRequest, DataEmitterSupport inSupport) throws UnsupportedRequestParameterType, IllegalRequestParameterValue
requestData in interface DataEmitterUnsupportedRequestParameterTypeIllegalRequestParameterValuepublic void cancel(DataFlowID inFlowID, RequestID inRequestID)
cancel in interface DataEmitterpublic void receiveData(DataFlowID inFlowID, Object inData) throws UnsupportedDataTypeException, StopDataFlowException
receiveData in interface DataReceiverUnsupportedDataTypeExceptionStopDataFlowExceptionpublic String getConfiguration()
CEPEsperProcessorMXBeangetConfiguration in interface CEPEsperProcessorMXBeanpublic void setConfiguration(String inConfiguration)
CEPEsperProcessorMXBeansetConfiguration in interface CEPEsperProcessorMXBeaninConfiguration - the location of the configuration file.CEPEsperProcessorMXBean.getConfiguration()public String[] getStatementNames()
CEPEsperProcessorMXBeangetStatementNames in interface CEPEsperProcessorMXBeanpublic long getNumEventsReceived()
CEPEsperProcessorMXBeangetNumEventsReceived in interface CEPEsperProcessorMXBeanpublic boolean isUseExternalTime()
CEPEsperProcessorMXBeanisUseExternalTime in interface CEPEsperProcessorMXBeanpublic void setUseExternalTime(boolean inUseExternalTime)
CEPEsperProcessorMXBeansetUseExternalTime in interface CEPEsperProcessorMXBeaninUseExternalTime - if the runtime should use external time source.protected void preStart()
throws ModuleException
preStart in class ModuleModuleExceptionprotected ArrayList<com.espertech.esper.client.EPStatement> createStatements(String... inQuery) throws com.espertech.esper.client.EPException
inQuery - the EPL and Pattern queries.com.espertech.esper.client.EPException - in case the statements cannot be createdCopyright © 2014. All Rights Reserved.