public abstract class AbstractRecordTable extends Table
ComplexEventChunk
so that
developer can directly work with event data.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractRecordTable.RecordStoreCompiledCondition
Compiled condition of the
AbstractRecordTable |
Modifier and Type | Field and Description |
---|---|
protected RecordTableHandler |
recordTableHandler |
protected StreamEventFactory |
storeEventPool |
tableDefinition
Constructor and Description |
---|
AbstractRecordTable() |
Modifier and Type | Method and Description |
---|---|
void |
add(ComplexEventChunk<StreamEvent> addingEventChunk) |
protected abstract void |
add(List<Object[]> records)
Add records to the Table
|
protected abstract CompiledCondition |
compileCondition(ExpressionBuilder expressionBuilder)
Compile the matching expression
|
CompiledCondition |
compileCondition(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.
|
protected abstract CompiledExpression |
compileSetAttribute(ExpressionBuilder expressionBuilder)
Compiles the expression in a set clause
|
CompiledUpdateSet |
compileUpdateSet(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 abstract boolean |
contains(Map<String,Object> containsConditionParameterMap,
CompiledCondition compiledCondition)
Check if matching record exist
|
boolean |
contains(StateEvent matchingEvent,
CompiledCondition compiledCondition) |
void |
delete(ComplexEventChunk<StateEvent> deletingEventChunk,
CompiledCondition compiledCondition) |
protected abstract void |
delete(List<Map<String,Object>> deleteConditionParameterMaps,
CompiledCondition compiledCondition)
Delete all matching records
|
StreamEvent |
find(CompiledCondition compiledCondition,
StateEvent matchingEvent) |
protected abstract RecordIterator<Object[]> |
find(Map<String,Object> findConditionParameterMap,
CompiledCondition compiledCondition)
Find records matching the compiled condition
|
io.siddhi.query.api.definition.TableDefinition |
getTableDefinition() |
protected abstract void |
init(io.siddhi.query.api.definition.TableDefinition tableDefinition,
ConfigReader configReader)
Initializing the Record Table
|
void |
init(io.siddhi.query.api.definition.TableDefinition tableDefinition,
StreamEventFactory storeEventPool,
StreamEventCloner storeEventCloner,
ConfigReader configReader,
SiddhiAppContext siddhiAppContext,
RecordTableHandler recordTableHandler) |
protected abstract void |
update(CompiledCondition updateCondition,
List<Map<String,Object>> updateConditionParameterMaps,
Map<String,CompiledExpression> updateSetExpressions,
List<Map<String,Object>> updateSetParameterMaps)
Update all matching records
|
void |
update(ComplexEventChunk<StateEvent> updatingEventChunk,
CompiledCondition compiledCondition,
CompiledUpdateSet compiledUpdateSet) |
protected abstract void |
updateOrAdd(CompiledCondition updateCondition,
List<Map<String,Object>> updateConditionParameterMaps,
Map<String,CompiledExpression> updateSetExpressions,
List<Map<String,Object>> updateSetParameterMaps,
List<Object[]> addingRecords)
Try updating the records if they exist else add the records
|
void |
updateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk,
CompiledCondition compiledCondition,
CompiledUpdateSet compiledUpdateSet,
AddingStreamEventExtractor addingStreamEventExtractor) |
addEvents, connect, connectWithRetry, containsEvent, deleteEvents, destroy, disconnect, find, getHandler, initTable, shutdown, updateEvents, updateOrAddEvents
protected StreamEventFactory storeEventPool
protected RecordTableHandler recordTableHandler
public void init(io.siddhi.query.api.definition.TableDefinition tableDefinition, StreamEventFactory storeEventPool, StreamEventCloner storeEventCloner, ConfigReader configReader, SiddhiAppContext siddhiAppContext, RecordTableHandler recordTableHandler)
protected abstract void init(io.siddhi.query.api.definition.TableDefinition tableDefinition, ConfigReader configReader)
tableDefinition
- definition of the table with annotations if anyconfigReader
- this hold the AbstractRecordTable
configuration reader.public io.siddhi.query.api.definition.TableDefinition getTableDefinition()
getTableDefinition
in class Table
public void add(ComplexEventChunk<StreamEvent> addingEventChunk) throws ConnectionUnavailableException
add
in class Table
ConnectionUnavailableException
protected abstract void add(List<Object[]> records) throws ConnectionUnavailableException
records
- records that need to be added to the table, each Object[] represent a record and it will match
the attributes of the Table Definition.ConnectionUnavailableException
public StreamEvent find(CompiledCondition compiledCondition, StateEvent matchingEvent) throws ConnectionUnavailableException
find
in class Table
ConnectionUnavailableException
protected abstract RecordIterator<Object[]> find(Map<String,Object> findConditionParameterMap, CompiledCondition compiledCondition) throws ConnectionUnavailableException
findConditionParameterMap
- map of matching StreamVariable Ids and their values
corresponding to the compiled conditioncompiledCondition
- the compiledCondition against which records should be matchedConnectionUnavailableException
public boolean contains(StateEvent matchingEvent, CompiledCondition compiledCondition) throws ConnectionUnavailableException
contains
in class Table
ConnectionUnavailableException
protected abstract boolean contains(Map<String,Object> containsConditionParameterMap, CompiledCondition compiledCondition) throws ConnectionUnavailableException
containsConditionParameterMap
- map of matching StreamVariable Ids and their values corresponding to the
compiled conditioncompiledCondition
- the compiledCondition against which records should be matchedConnectionUnavailableException
public void delete(ComplexEventChunk<StateEvent> deletingEventChunk, CompiledCondition compiledCondition) throws ConnectionUnavailableException
delete
in class Table
ConnectionUnavailableException
protected abstract void delete(List<Map<String,Object>> deleteConditionParameterMaps, CompiledCondition compiledCondition) throws ConnectionUnavailableException
deleteConditionParameterMaps
- map of matching StreamVariable Ids and their values corresponding to the
compiled conditioncompiledCondition
- the compiledCondition against which records should be matched for deletionConnectionUnavailableException
public void update(ComplexEventChunk<StateEvent> updatingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet) throws ConnectionUnavailableException
update
in class Table
ConnectionUnavailableException
protected abstract void update(CompiledCondition updateCondition, List<Map<String,Object>> updateConditionParameterMaps, Map<String,CompiledExpression> updateSetExpressions, List<Map<String,Object>> updateSetParameterMaps) throws ConnectionUnavailableException
updateCondition
- the compiledCondition against which records should be matched for updateupdateConditionParameterMaps
- map of matching StreamVariable Ids and their values corresponding to the
compiled condition based on which the records will be updatedupdateSetExpressions
- the set of updates mappings and related complied expressionsupdateSetParameterMaps
- map of matching StreamVariable Ids and their values corresponding to theConnectionUnavailableException
public void updateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet, AddingStreamEventExtractor addingStreamEventExtractor) throws ConnectionUnavailableException
updateOrAdd
in class Table
ConnectionUnavailableException
protected abstract void updateOrAdd(CompiledCondition updateCondition, List<Map<String,Object>> updateConditionParameterMaps, Map<String,CompiledExpression> updateSetExpressions, List<Map<String,Object>> updateSetParameterMaps, List<Object[]> addingRecords) throws ConnectionUnavailableException
updateCondition
- the compiledCondition against which records should be matched for updateupdateConditionParameterMaps
- map of matching StreamVariable Ids and their values corresponding to the
compiled condition based on which the records will be updatedupdateSetExpressions
- the set of updates mappings and related complied expressionsupdateSetParameterMaps
- map of matching StreamVariable Ids and their values corresponding to the
update setaddingRecords
- the values for adding new records if the update condition did not matchConnectionUnavailableException
public CompiledCondition compileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)
FindableProcessor
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 contextpublic CompiledUpdateSet compileUpdateSet(io.siddhi.query.api.execution.query.output.stream.UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)
Table
compileUpdateSet
in class Table
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 contextprotected abstract CompiledCondition compileCondition(ExpressionBuilder expressionBuilder)
expressionBuilder
- helps visiting the conditions in order to compile the conditionprotected abstract CompiledExpression compileSetAttribute(ExpressionBuilder expressionBuilder)
expressionBuilder
- helps visiting the conditions in order to compile the conditionCopyright © 2019. All rights reserved.