public abstract class AbstractRecordTable extends Table
ComplexEventChunk so that
developer can directly work with event data.| 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(org.wso2.siddhi.query.api.expression.Expression condition,
MatchingMetaInfoHolder matchingMetaInfoHolder,
SiddhiAppContext siddhiAppContext,
List<VariableExpressionExecutor> variableExpressionExecutors,
Map<String,Table> tableMap,
String queryName)
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(org.wso2.siddhi.query.api.execution.query.output.stream.UpdateSet updateSet,
MatchingMetaInfoHolder matchingMetaInfoHolder,
SiddhiAppContext siddhiAppContext,
List<VariableExpressionExecutor> variableExpressionExecutors,
Map<String,Table> tableMap,
String queryName)
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
|
org.wso2.siddhi.query.api.definition.TableDefinition |
getTableDefinition() |
protected abstract void |
init(org.wso2.siddhi.query.api.definition.TableDefinition tableDefinition,
ConfigReader configReader)
Initializing the Record Table
|
void |
init(org.wso2.siddhi.query.api.definition.TableDefinition tableDefinition,
StreamEventPool 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, updateOrAddEventspublic void init(org.wso2.siddhi.query.api.definition.TableDefinition tableDefinition,
StreamEventPool storeEventPool,
StreamEventCloner storeEventCloner,
ConfigReader configReader,
SiddhiAppContext siddhiAppContext,
RecordTableHandler recordTableHandler)
protected abstract void init(org.wso2.siddhi.query.api.definition.TableDefinition tableDefinition,
ConfigReader configReader)
tableDefinition - definition of the table with annotations if anyconfigReader - this hold the AbstractRecordTable configuration reader.public org.wso2.siddhi.query.api.definition.TableDefinition getTableDefinition()
getTableDefinition in class Tablepublic void add(ComplexEventChunk<StreamEvent> addingEventChunk) throws ConnectionUnavailableException
add in class TableConnectionUnavailableExceptionprotected 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.ConnectionUnavailableExceptionpublic StreamEvent find(CompiledCondition compiledCondition, StateEvent matchingEvent) throws ConnectionUnavailableException
find in class TableConnectionUnavailableExceptionprotected 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 matchedConnectionUnavailableExceptionpublic boolean contains(StateEvent matchingEvent, CompiledCondition compiledCondition) throws ConnectionUnavailableException
contains in class TableConnectionUnavailableExceptionprotected 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 matchedConnectionUnavailableExceptionpublic void delete(ComplexEventChunk<StateEvent> deletingEventChunk, CompiledCondition compiledCondition) throws ConnectionUnavailableException
delete in class TableConnectionUnavailableExceptionprotected 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 deletionConnectionUnavailableExceptionpublic void update(ComplexEventChunk<StateEvent> updatingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet) throws ConnectionUnavailableException
update in class TableConnectionUnavailableExceptionprotected 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 theConnectionUnavailableExceptionpublic void updateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet, AddingStreamEventExtractor addingStreamEventExtractor) throws ConnectionUnavailableException
updateOrAdd in class TableConnectionUnavailableExceptionprotected 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 matchConnectionUnavailableExceptionpublic CompiledCondition compileCondition(org.wso2.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, SiddhiAppContext siddhiAppContext, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, String queryName)
FindableProcessorcondition - the matching conditionmatchingMetaInfoHolder - the meta structure of the incoming matchingEventsiddhiAppContext - current siddhi app contextvariableExpressionExecutors - the list of variable ExpressionExecutors already createdtableMap - map of event tablesqueryName - query name of findable processor belongs to.public CompiledUpdateSet compileUpdateSet(org.wso2.siddhi.query.api.execution.query.output.stream.UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, SiddhiAppContext siddhiAppContext, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, String queryName)
TablecompileUpdateSet in class TableupdateSet - 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 matchingEventsiddhiAppContext - current siddhi app contextvariableExpressionExecutors - the list of variable ExpressionExecutors already createdtableMap - map of event tablesqueryName - query name to which the update statement belongs.protected 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 © 2017 WSO2. All rights reserved.