public abstract class AbstractQueryableRecordTable extends AbstractRecordTable implements QueryableProcessor
ComplexEventChunk
so that
developer can directly work with event data.Modifier and Type | Class and Description |
---|---|
class |
AbstractQueryableRecordTable.CompiledSelectionWithCache
class to hold both store compile selection and cache compile selection wrapped
|
class |
AbstractQueryableRecordTable.OrderByAttributeBuilder
Holder of order by attribute with order orientation
|
class |
AbstractQueryableRecordTable.SelectAttributeBuilder
Holder of Selection attribute with renaming field
|
Table.OnErrorAction
Modifier and Type | Field and Description |
---|---|
protected StateEvent |
containsMatchingEvent |
protected StateEvent |
findMatchingEvent |
protected MatchingMetaInfoHolder |
matchingMetaInfoHolderForTestOnDemandQuery |
static ThreadLocal<Boolean> |
queryStoreWithoutCheckingCache |
protected io.siddhi.query.api.execution.query.selection.Selector |
selectorForTestOnDemandQuery |
protected SiddhiQueryContext |
siddhiQueryContextForTestOnDemandQuery |
recordTableHandler, storeEventPool
siddhiAppContext, tableDefinition, tableMap
Constructor and Description |
---|
AbstractQueryableRecordTable() |
Modifier and Type | Method and Description |
---|---|
void |
add(ComplexEventChunk<StreamEvent> addingEventChunk) |
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 CompiledSelection |
compileSelection(List<AbstractQueryableRecordTable.SelectAttributeBuilder> selectAttributeBuilders,
List<ExpressionBuilder> groupByExpressionBuilder,
ExpressionBuilder havingExpressionBuilder,
List<AbstractQueryableRecordTable.OrderByAttributeBuilder> orderByAttributeBuilders,
Long limit,
Long offset)
Compile the query selection
|
CompiledSelection |
compileSelection(io.siddhi.query.api.execution.query.selection.Selector selector,
List<io.siddhi.query.api.definition.Attribute> expectedOutputAttributes,
MatchingMetaInfoHolder matchingMetaInfoHolder,
List<VariableExpressionExecutor> variableExpressionExecutors,
Map<String,Table> tableMap,
SiddhiQueryContext siddhiQueryContext)
To construct a selection having the capability of transforming events based on given selection logic.
|
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 void |
connectAndLoadCache() |
boolean |
contains(StateEvent matchingEvent,
CompiledCondition compiledCondition) |
void |
delete(ComplexEventChunk<StateEvent> deletingEventChunk,
CompiledCondition compiledCondition) |
StreamEvent |
find(CompiledCondition compiledCondition,
StateEvent matchingEvent) |
void |
handleCacheExpiry(CompiledCondition cacheExpiryCompiledCondition,
ComplexEventChunk<StateEvent> deleteEventChunk) |
void |
initCache(io.siddhi.query.api.definition.TableDefinition tableDefinition,
SiddhiAppContext siddhiAppContext,
StreamEventCloner storeEventCloner,
ConfigReader configReader) |
protected abstract RecordIterator<Object[]> |
query(Map<String,Object> parameterMap,
CompiledCondition compiledCondition,
CompiledSelection compiledSelection,
io.siddhi.query.api.definition.Attribute[] outputAttributes)
Query records matching the compiled condition and selection
|
StreamEvent |
query(StateEvent matchingEvent,
CompiledCondition compiledCondition,
CompiledSelection compiledSelection)
To find events from the processor event pool, that the matches the matchingEvent based on finder logic and
return them based on the defined selection.
|
StreamEvent |
query(StateEvent matchingEvent,
CompiledCondition compiledCondition,
CompiledSelection compiledSelection,
io.siddhi.query.api.definition.Attribute[] outputAttributes)
To find events from the processor event pool, that the matches the matchingEvent based on finder logic and
return them based on the defined selection.
|
void |
update(ComplexEventChunk<StateEvent> updatingEventChunk,
CompiledCondition compiledCondition,
CompiledUpdateSet compiledUpdateSet) |
void |
updateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk,
CompiledCondition compiledCondition,
CompiledUpdateSet compiledUpdateSet,
AddingStreamEventExtractor addingStreamEventExtractor) |
add, compileCondition, compileSetAttribute, connect, contains, delete, find, getTableDefinition, init, init, isStateful, update, updateOrAdd
addEvents, connectWithRetry, containsEvent, deleteEvents, destroy, disconnect, find, getHandler, getIsConnected, getIsTryingToConnect, initTable, onAddError, onDeleteError, onUpdateError, onUpdateOrAddError, setIsConnectedToFalse, shutdown, updateEvents, updateOrAddEvents, waitWhileConnect
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
find
public static ThreadLocal<Boolean> queryStoreWithoutCheckingCache
protected StateEvent findMatchingEvent
protected io.siddhi.query.api.execution.query.selection.Selector selectorForTestOnDemandQuery
protected SiddhiQueryContext siddhiQueryContextForTestOnDemandQuery
protected MatchingMetaInfoHolder matchingMetaInfoHolderForTestOnDemandQuery
protected StateEvent containsMatchingEvent
public void initCache(io.siddhi.query.api.definition.TableDefinition tableDefinition, SiddhiAppContext siddhiAppContext, StreamEventCloner storeEventCloner, ConfigReader configReader)
initCache
in class AbstractRecordTable
protected void connectAndLoadCache() throws ConnectionUnavailableException
connectAndLoadCache
in class AbstractRecordTable
ConnectionUnavailableException
public StreamEvent query(StateEvent matchingEvent, CompiledCondition compiledCondition, CompiledSelection compiledSelection) throws ConnectionUnavailableException
QueryableProcessor
query
in interface QueryableProcessor
matchingEvent
- the event to be matched with the events at the processorcompiledCondition
- the execution element responsible for matching the corresponding events that matches
the matchingEvent based on pool of events at ProcessorcompiledSelection
- the execution element responsible for transforming the corresponding events to the
given selectionConnectionUnavailableException
public void add(ComplexEventChunk<StreamEvent> addingEventChunk)
add
in class AbstractRecordTable
public void delete(ComplexEventChunk<StateEvent> deletingEventChunk, CompiledCondition compiledCondition)
delete
in class AbstractRecordTable
public void update(ComplexEventChunk<StateEvent> updatingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet)
update
in class AbstractRecordTable
public boolean contains(StateEvent matchingEvent, CompiledCondition compiledCondition) throws ConnectionUnavailableException
contains
in class AbstractRecordTable
ConnectionUnavailableException
public void updateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet, AddingStreamEventExtractor addingStreamEventExtractor)
updateOrAdd
in class AbstractRecordTable
public StreamEvent find(CompiledCondition compiledCondition, StateEvent matchingEvent) throws ConnectionUnavailableException
find
in class AbstractRecordTable
ConnectionUnavailableException
public 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 AbstractRecordTable
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 contextpublic CompiledCondition compileCondition(io.siddhi.query.api.expression.Expression condition, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)
FindableProcessor
compileCondition
in interface FindableProcessor
compileCondition
in class AbstractRecordTable
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 StreamEvent query(StateEvent matchingEvent, CompiledCondition compiledCondition, CompiledSelection compiledSelection, io.siddhi.query.api.definition.Attribute[] outputAttributes) throws ConnectionUnavailableException
QueryableProcessor
query
in interface QueryableProcessor
matchingEvent
- the event to be matched with the events at the processorcompiledCondition
- the execution element responsible for matching the corresponding events that matches
the matchingEvent based on pool of events at ProcessorcompiledSelection
- the execution element responsible for transforming the corresponding events to the
given selectionoutputAttributes
- the output attributes specified in the query.ConnectionUnavailableException
protected abstract RecordIterator<Object[]> query(Map<String,Object> parameterMap, CompiledCondition compiledCondition, CompiledSelection compiledSelection, io.siddhi.query.api.definition.Attribute[] outputAttributes) throws ConnectionUnavailableException
parameterMap
- map of matching StreamVariable Ids and their values
corresponding to the compiled condition and selectioncompiledCondition
- the compiledCondition against which records should be matchedcompiledSelection
- the compiledSelection that maps records based to requested formatConnectionUnavailableException
public CompiledSelection compileSelection(io.siddhi.query.api.execution.query.selection.Selector selector, List<io.siddhi.query.api.definition.Attribute> expectedOutputAttributes, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)
QueryableProcessor
compileSelection
in interface QueryableProcessor
selector
- the query selectormatchingMetaInfoHolder
- the meta structure of the incoming matchingEventvariableExpressionExecutors
- the list of variable ExpressionExecutors already createdtableMap
- map of event tablessiddhiQueryContext
- current siddhi query contextprotected abstract CompiledSelection compileSelection(List<AbstractQueryableRecordTable.SelectAttributeBuilder> selectAttributeBuilders, List<ExpressionBuilder> groupByExpressionBuilder, ExpressionBuilder havingExpressionBuilder, List<AbstractQueryableRecordTable.OrderByAttributeBuilder> orderByAttributeBuilders, Long limit, Long offset)
selectAttributeBuilders
- helps visiting the select attributes in ordergroupByExpressionBuilder
- helps visiting the group by attributes in orderhavingExpressionBuilder
- helps visiting the having conditionorderByAttributeBuilders
- helps visiting the order by attributes in orderlimit
- defines the limit leveloffset
- defines the offset levelpublic void handleCacheExpiry(CompiledCondition cacheExpiryCompiledCondition, ComplexEventChunk<StateEvent> deleteEventChunk)
Copyright © 2021. All rights reserved.