public class Query
extends stream.AbstractProcessor
implements stream.Configurable
Streams-Esper Query objects represent Esper statements. They are Streams
Processor objects and refer to an
EsperEngine.
The BodyText of an XML configuration element represents
the actual Esper statement. References to the Esper engine are provided via
an attribute.
Note that the Esper types for this query must be delcared to the Esper engine this Query object references.
EsperEngine| Constructor and Description |
|---|
Query() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Element document) |
void |
finish() |
String |
getEngine() |
protected EsperEngine |
getEsperEngine() |
String |
getInputType() |
String |
getName() |
stream.io.Sink[] |
getOutput() |
String |
getQuery() |
void |
init(stream.ProcessContext ctx)
Fetches the Esper engine from the EsperEngine's registry and adds this
query to the engine.
|
boolean |
isForward() |
Boolean |
isRemoveBackticks() |
stream.Data |
process(stream.Data input)
Hand over the
Data item to the referenced
EsperEngine. |
void |
setEngine(String engine) |
protected void |
setEsperEngine(EsperEngine esperEngine) |
void |
setForward(Boolean forward) |
void |
setInputType(String inputType) |
void |
setName(String name) |
void |
setOutput(stream.io.Sink[] output) |
void |
setQuery(stream.annotations.BodyContent esperQuery) |
void |
setRemoveBackticks(Boolean removeBackticks) |
public stream.Data process(stream.Data input)
Hand over the Data item to the referenced
EsperEngine.
process in interface stream.Processorpublic void init(stream.ProcessContext ctx)
throws Exception
Fetches the Esper engine from the EsperEngine's registry and adds this query to the engine.
init in interface stream.StatefulProcessorinit in class stream.AbstractProcessorNullPointerException - if no Esper engine was configured.Exceptionpublic void finish()
throws Exception
finish in interface stream.StatefulProcessorfinish in class stream.AbstractProcessorExceptionpublic String getQuery()
protected EsperEngine getEsperEngine()
protected void setEsperEngine(EsperEngine esperEngine)
esperEngine - the esperEngine to setpublic void setQuery(stream.annotations.BodyContent esperQuery)
IllegalArgumentException - if the query has already been set.@Parameter public void setOutput(stream.io.Sink[] output)
IllegalArgumentException - if the sinks have already been set.public stream.io.Sink[] getOutput()
@Parameter(defaultValue="default",
required=false)
public void setEngine(String engine)
IllegalArgumentException - if the engine id has already been set.public String getEngine()
@Parameter(required=false,
description="The optional name for the Esper statement.")
public void setName(String name)
public String getName()
@Parameter(required=false,
defaultValue="false",
description="Flag whether to remove backticks from the keys.")
public void setRemoveBackticks(Boolean removeBackticks)
public Boolean isRemoveBackticks()
@Parameter(required=false,
defaultValue="",
description="If this parameter is set we assume that events input to this query are of a Map type.")
public void setInputType(String inputType)
public String getInputType()
@Parameter(defaultValue="false",
name="forward-input",
description="Flag that inicates whether a data item should be forwarded to later processors. ")
public void setForward(Boolean forward)
public boolean isForward()
public void configure(Element document)
configure in interface stream.ConfigurableConfigurable.configure(org.w3c.dom.Element)Copyright © 2013-2017 University of Dortmund. All Rights Reserved.