public abstract class AbstractKTimeBatchStreamProcessorExtension
extends org.wso2.siddhi.core.query.processor.stream.StreamProcessor
implements org.wso2.siddhi.core.query.processor.SchedulingProcessor, org.wso2.siddhi.core.query.processor.stream.window.FindableProcessor
Sample Query (For bottomKLengthBatch implementation): from inputStream#extrema:bottomKTimeBatch(attribute1, 1 sec, 3) select attribute1, attribute2 insert into outputStream;
Description: In the example query given, 1 sec is the duration 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 |
|---|
AbstractKTimeBatchStreamProcessorExtension() |
| Modifier and Type | Method and Description |
|---|---|
org.wso2.siddhi.core.util.collection.operator.Finder |
constructFinder(org.wso2.siddhi.query.api.expression.Expression expression,
org.wso2.siddhi.core.util.collection.operator.MatchingMetaStateHolder matchingMetaStateHolder,
org.wso2.siddhi.core.config.ExecutionPlanContext executionPlanContext,
List<org.wso2.siddhi.core.executor.VariableExpressionExecutor> variableExpressionExecutors,
Map<String,org.wso2.siddhi.core.table.EventTable> eventTableMap) |
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() |
org.wso2.siddhi.core.event.stream.StreamEvent |
find(org.wso2.siddhi.core.event.state.StateEvent matchingEvent,
org.wso2.siddhi.core.util.collection.operator.Finder finder) |
protected abstract String |
getExtensionNamePrefix()
Return the name prefix that should be used in
the returning extra parameters and in the ExecutionPlanValidationException that might get thrown
Should be either "Top" or "Bottom" to indicate whether it is top K or bottom K
|
org.wso2.siddhi.core.util.Scheduler |
getScheduler() |
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 |
setScheduler(org.wso2.siddhi.core.util.Scheduler scheduler) |
void |
start() |
void |
stop() |
init, processEventChunkcloneProcessor, constructStreamEventPopulater, getElementId, getNextProcessor, initProcessor, process, setNextProcessor, setStreamEventCloner, setToLastpublic AbstractKTimeBatchStreamProcessorExtension()
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)
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()
start in interface org.wso2.siddhi.core.util.extension.holder.EternalReferencedHolderpublic void stop()
stop in interface org.wso2.siddhi.core.util.extension.holder.EternalReferencedHolderpublic Object[] currentState()
currentState in interface org.wso2.siddhi.core.util.snapshot.Snapshotablepublic void restoreState(Object[] state)
restoreState in interface org.wso2.siddhi.core.util.snapshot.Snapshotablepublic org.wso2.siddhi.core.util.Scheduler getScheduler()
getScheduler in interface org.wso2.siddhi.core.query.processor.SchedulingProcessorpublic void setScheduler(org.wso2.siddhi.core.util.Scheduler scheduler)
setScheduler in interface org.wso2.siddhi.core.query.processor.SchedulingProcessorpublic org.wso2.siddhi.core.event.stream.StreamEvent find(org.wso2.siddhi.core.event.state.StateEvent matchingEvent,
org.wso2.siddhi.core.util.collection.operator.Finder finder)
find in interface org.wso2.siddhi.core.query.processor.stream.window.FindableProcessorpublic org.wso2.siddhi.core.util.collection.operator.Finder constructFinder(org.wso2.siddhi.query.api.expression.Expression expression,
org.wso2.siddhi.core.util.collection.operator.MatchingMetaStateHolder matchingMetaStateHolder,
org.wso2.siddhi.core.config.ExecutionPlanContext executionPlanContext,
List<org.wso2.siddhi.core.executor.VariableExpressionExecutor> variableExpressionExecutors,
Map<String,org.wso2.siddhi.core.table.EventTable> eventTableMap)
constructFinder 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.