public abstract class AbstractKLengthBatchStreamProcessorExtension
extends org.wso2.siddhi.core.query.processor.stream.StreamProcessor
implements org.wso2.siddhi.core.query.processor.stream.window.FindableProcessor
Sample Query (For bottomKLengthBatch implementation): from inputStream#extrema:bottomKLengthBatch(attribute1, 6, 3) select attribute1, attribute2 insert into outputStream;
Description: In the example query given, 6 is the length of the window, 3 is the k-value and attribute1 is the attribute of which the frequency is counted. The frequencies of the values received for the attribute given will be counted by this and the topK/bottomK values will be emitted per batch. Events will not emit if there is no change from the last send topK/bottomK results
| Constructor and Description |
|---|
AbstractKLengthBatchStreamProcessorExtension() |
| Modifier and Type | Method and Description |
|---|---|
org.wso2.siddhi.core.util.collection.operator.CompiledCondition |
compileCondition(org.wso2.siddhi.query.api.expression.Expression expression,
org.wso2.siddhi.core.util.collection.operator.MatchingMetaInfoHolder matchingMetaInfoHolder,
org.wso2.siddhi.core.config.SiddhiAppContext siddhiAppContext,
List<org.wso2.siddhi.core.executor.VariableExpressionExecutor> variableExpressionExecutors,
Map<String,org.wso2.siddhi.core.table.Table> tableMap,
String queryName) |
protected abstract AbstractTopKBottomKFinder<Object> |
createNewTopKBottomKFinder()
Create and return either a TopKFinder or a BottomKFinder
Should be implemented by the child classes which will determine whether it is top K or bottom K
|
Map<String,Object> |
currentState() |
org.wso2.siddhi.core.event.stream.StreamEvent |
find(org.wso2.siddhi.core.event.state.StateEvent matchingEvent,
org.wso2.siddhi.core.util.collection.operator.CompiledCondition compiledCondition) |
protected abstract String |
getExtensionNamePrefix()
Return the name prefix that should be used in the returning extra parameters and
in the exception that might get thrown
Should be either "Top" or "Bottom" to indicate whether it is top K or bottom K
|
protected List<org.wso2.siddhi.query.api.definition.Attribute> |
init(org.wso2.siddhi.query.api.definition.AbstractDefinition abstractDefinition,
org.wso2.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors,
org.wso2.siddhi.core.util.config.ConfigReader configReader,
org.wso2.siddhi.core.config.SiddhiAppContext siddhiAppContext) |
protected void |
process(org.wso2.siddhi.core.event.ComplexEventChunk<org.wso2.siddhi.core.event.stream.StreamEvent> streamEventChunk,
org.wso2.siddhi.core.query.processor.Processor nextProcessor,
org.wso2.siddhi.core.event.stream.StreamEventCloner streamEventCloner,
org.wso2.siddhi.core.event.stream.populater.ComplexEventPopulater complexEventPopulater) |
void |
restoreState(Map<String,Object> state) |
void |
start() |
void |
stop() |
init, processEventChunkpublic AbstractKLengthBatchStreamProcessorExtension()
protected void process(org.wso2.siddhi.core.event.ComplexEventChunk<org.wso2.siddhi.core.event.stream.StreamEvent> streamEventChunk,
org.wso2.siddhi.core.query.processor.Processor nextProcessor,
org.wso2.siddhi.core.event.stream.StreamEventCloner streamEventCloner,
org.wso2.siddhi.core.event.stream.populater.ComplexEventPopulater complexEventPopulater)
process in class org.wso2.siddhi.core.query.processor.stream.StreamProcessorprotected List<org.wso2.siddhi.query.api.definition.Attribute> init(org.wso2.siddhi.query.api.definition.AbstractDefinition abstractDefinition, org.wso2.siddhi.core.executor.ExpressionExecutor[] attributeExpressionExecutors, org.wso2.siddhi.core.util.config.ConfigReader configReader, org.wso2.siddhi.core.config.SiddhiAppContext siddhiAppContext)
init in class org.wso2.siddhi.core.query.processor.stream.StreamProcessorpublic void start()
start in interface org.wso2.siddhi.core.util.extension.holder.EternalReferencedHolderpublic void stop()
stop in interface org.wso2.siddhi.core.util.extension.holder.EternalReferencedHolderpublic Map<String,Object> currentState()
currentState in interface org.wso2.siddhi.core.util.snapshot.Snapshotablepublic void restoreState(Map<String,Object> state)
restoreState in interface org.wso2.siddhi.core.util.snapshot.Snapshotablepublic org.wso2.siddhi.core.event.stream.StreamEvent find(org.wso2.siddhi.core.event.state.StateEvent matchingEvent,
org.wso2.siddhi.core.util.collection.operator.CompiledCondition compiledCondition)
find in interface org.wso2.siddhi.core.query.processor.stream.window.FindableProcessorpublic org.wso2.siddhi.core.util.collection.operator.CompiledCondition compileCondition(org.wso2.siddhi.query.api.expression.Expression expression,
org.wso2.siddhi.core.util.collection.operator.MatchingMetaInfoHolder matchingMetaInfoHolder,
org.wso2.siddhi.core.config.SiddhiAppContext siddhiAppContext,
List<org.wso2.siddhi.core.executor.VariableExpressionExecutor> variableExpressionExecutors,
Map<String,org.wso2.siddhi.core.table.Table> tableMap,
String queryName)
compileCondition in interface org.wso2.siddhi.core.query.processor.stream.window.FindableProcessorprotected abstract AbstractTopKBottomKFinder<Object> createNewTopKBottomKFinder()
protected abstract String getExtensionNamePrefix()
Copyright © 2017 WSO2. All rights reserved.