public class EsperStatementSubscriber extends Object
The subscriber outputs data from an
EPStatement to a Streams
QueueService.
A subscriber object directly binds query results to a Java object. According
the the Esper documentation a subscriber is much faster than an
UpdateListener.
This class provides a generic implementation of a subscriber. As such it
needs to know (i) the Streams sink it shall write data to and (ii) the keys
for the Streams Data item. The subscriber follows no implementation
pattern but requiring the subscriber class to implement an update method.
This #update(Object...) method is simply requires to have an array of
or a fixed number of objects as parameters. To have a generic implementation,
we need to know the keys (in the extreme only the number of parameters) for
the Streams Data item.
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_STREAM
Key of the name of the stream in data items.
|
| Constructor and Description |
|---|
EsperStatementSubscriber(List<stream.io.Sink> sinksList,
String[] keys)
Create a new subscriber with the specified keys writing to the specified
Sink. |
| Modifier and Type | Method and Description |
|---|---|
void |
update(Map<String,Serializable> values) |
void |
update(Serializable... values) |
protected void |
write(stream.Data item)
Write the data item to all sinks.
|
public static final String KEY_STREAM
public void update(Serializable... values) throws Exception
values - the values of an Esper event.Exceptionpublic void update(Map<String,Serializable> values) throws Exception
values - the values of an Esper event.ExceptionCopyright © 2013-2017 University of Dortmund. All Rights Reserved.