Package io.siddhi.core.table
Class InMemoryTable
- java.lang.Object
-
- io.siddhi.core.table.Table
-
- io.siddhi.core.table.InMemoryTable
-
- All Implemented Interfaces:
FindableProcessor,MemoryCalculable
- Direct Known Subclasses:
CacheTable
public class InMemoryTable extends Table
In-memory event table implementation of SiddhiQL.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classInMemoryTable.TableStateclass to store the state of table-
Nested classes/interfaces inherited from class io.siddhi.core.table.Table
Table.OnErrorAction
-
-
Field Summary
-
Fields inherited from class io.siddhi.core.table.Table
siddhiAppContext, tableDefinition, tableMap
-
-
Constructor Summary
Constructors Constructor Description InMemoryTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ComplexEventChunk<StreamEvent> addingEventChunk)CompiledConditioncompileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)To construct a finder having the capability of finding events at the processor that corresponds to the incoming matchingEvent and the given matching expression logic.CompiledUpdateSetcompileUpdateSet(io.siddhi.query.api.execution.query.output.stream.UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)Builds the "compiled" set clause of an update query.protected voidconnectAndLoadCache()booleancontains(StateEvent matchingEvent, CompiledCondition compiledCondition)voiddelete(ComplexEventChunk<StateEvent> deletingEventChunk, CompiledCondition compiledCondition)protected voiddestroy()protected voiddisconnect()StreamEventfind(CompiledCondition compiledCondition, StateEvent matchingEvent)io.siddhi.query.api.definition.TableDefinitiongetTableDefinition()voidinit(io.siddhi.query.api.definition.TableDefinition tableDefinition, StreamEventFactory storeEventPool, StreamEventCloner storeEventCloner, ConfigReader configReader, SiddhiAppContext siddhiAppContext, RecordTableHandler recordTableHandler)booleanisStateful()protected ComplexEventChunk<StreamEvent>reduceEventsForUpdateOrInsert(AddingStreamEventExtractor addingStreamEventExtractor, InMemoryCompiledCondition inMemoryCompiledCondition, InMemoryCompiledUpdateSet compiledUpdateSet, ComplexEventChunk<StateEvent> failedEvents)intsize()voidupdate(ComplexEventChunk<StateEvent> updatingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet)voidupdateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet, AddingStreamEventExtractor addingStreamEventExtractor)-
Methods inherited from class io.siddhi.core.table.Table
addEvents, connectWithRetry, containsEvent, deleteEvents, find, getHandler, getIsConnected, getIsTryingToConnect, initTable, onAddError, onDeleteError, onUpdateError, onUpdateOrAddError, setIsConnectedToFalse, shutdown, updateEvents, updateOrAddEvents, waitWhileConnect
-
-
-
-
Method Detail
-
init
public void init(io.siddhi.query.api.definition.TableDefinition tableDefinition, StreamEventFactory storeEventPool, StreamEventCloner storeEventCloner, ConfigReader configReader, SiddhiAppContext siddhiAppContext, RecordTableHandler recordTableHandler)
-
getTableDefinition
public io.siddhi.query.api.definition.TableDefinition getTableDefinition()
- Overrides:
getTableDefinitionin classTable
-
add
public void add(ComplexEventChunk<StreamEvent> addingEventChunk)
-
delete
public void delete(ComplexEventChunk<StateEvent> deletingEventChunk, CompiledCondition compiledCondition)
-
update
public void update(ComplexEventChunk<StateEvent> updatingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet)
-
updateOrAdd
public void updateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet, AddingStreamEventExtractor addingStreamEventExtractor)
- Specified by:
updateOrAddin classTable
-
reduceEventsForUpdateOrInsert
protected ComplexEventChunk<StreamEvent> reduceEventsForUpdateOrInsert(AddingStreamEventExtractor addingStreamEventExtractor, InMemoryCompiledCondition inMemoryCompiledCondition, InMemoryCompiledUpdateSet compiledUpdateSet, ComplexEventChunk<StateEvent> failedEvents)
-
contains
public boolean contains(StateEvent matchingEvent, CompiledCondition compiledCondition)
-
disconnect
protected void disconnect()
- Specified by:
disconnectin classTable
-
find
public StreamEvent find(CompiledCondition compiledCondition, StateEvent matchingEvent)
-
compileCondition
public CompiledCondition compileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)
Description copied from interface:FindableProcessorTo construct a finder having the capability of finding events at the processor that corresponds to the incoming matchingEvent and the given matching expression logic.- Parameters:
condition- the matching conditionmatchingMetaInfoHolder- the meta structure of the incoming matchingEventvariableExpressionExecutors- the list of variable ExpressionExecutors already createdtableMap- map of event tablessiddhiQueryContext- current siddhi query context- Returns:
- compiled Condition having the capability of matching events against the incoming matchingEvent
-
compileUpdateSet
public CompiledUpdateSet compileUpdateSet(io.siddhi.query.api.execution.query.output.stream.UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)
Description copied from class:TableBuilds the "compiled" set clause of an update query. Here, all the pre-processing that can be done prior to receiving the update event is done, so that such pre-processing work will not be done at each update-event-arrival.- Specified by:
compileUpdateSetin classTable- Parameters:
updateSet- the set of assignment expressions, each containing the table column to be updated and the expression to be assigned.matchingMetaInfoHolder- the meta structure of the incoming matchingEventvariableExpressionExecutors- the list of variable ExpressionExecutors already createdtableMap- map of event tablessiddhiQueryContext- current siddhi query context- Returns:
- CompiledUpdateSet
-
connectAndLoadCache
protected void connectAndLoadCache() throws ConnectionUnavailableException- Specified by:
connectAndLoadCachein classTable- Throws:
ConnectionUnavailableException
-
size
public int size()
-
isStateful
public boolean isStateful()
- Specified by:
isStatefulin classTable
-
-