public abstract class AbstractKStreamProcessorExtension
extends org.wso2.siddhi.core.query.processor.stream.StreamProcessor
Sample Query (For bottomKLengthBatch implementation): from inputStream#window.timeBatch(6)#extrema:bottomKTimeBatch(attribute1, 3) select attribute1, attribute2 insert into outputStream;
Description: In the example query given, 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 Events will be only emitted if there is a change in the topK/bottomK results for each received chunk of events
| Constructor and Description |
|---|
AbstractKStreamProcessorExtension() |
| Modifier and Type | Method and Description |
|---|---|
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
|
Object[] |
currentState() |
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.config.ExecutionPlanContext executionPlanContext) |
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(Object[] state) |
void |
start() |
void |
stop() |
init, processEventChunkprotected 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.config.ExecutionPlanContext executionPlanContext)
init in class org.wso2.siddhi.core.query.processor.stream.StreamProcessorprotected 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.StreamProcessorpublic void start()
public void stop()
public Object[] currentState()
public void restoreState(Object[] state)
protected abstract AbstractTopKBottomKFinder<Object> createNewTopKBottomKFinder()
protected abstract String getExtensionNamePrefix()
Copyright © 2017 WSO2. All rights reserved.