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
|
AbstractRecordTable.RecordStoreCompiledCondition| 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, storeEventPoolsiddhiAppContext, 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, updateOrAddaddEvents, connectWithRetry, containsEvent, deleteEvents, destroy, disconnect, find, getHandler, getIsConnected, getIsTryingToConnect, initTable, setIsConnectedToFalse, shutdown, updateEvents, updateOrAddEvents, waitWhileConnectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindpublic 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 AbstractRecordTableprotected void connectAndLoadCache()
throws ConnectionUnavailableException
connectAndLoadCache in class AbstractRecordTableConnectionUnavailableExceptionpublic StreamEvent query(StateEvent matchingEvent, CompiledCondition compiledCondition, CompiledSelection compiledSelection) throws ConnectionUnavailableException
QueryableProcessorquery in interface QueryableProcessormatchingEvent - 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 selectionConnectionUnavailableExceptionpublic void add(ComplexEventChunk<StreamEvent> addingEventChunk) throws ConnectionUnavailableException
add in class AbstractRecordTableConnectionUnavailableExceptionpublic void delete(ComplexEventChunk<StateEvent> deletingEventChunk, CompiledCondition compiledCondition) throws ConnectionUnavailableException
delete in class AbstractRecordTableConnectionUnavailableExceptionpublic void update(ComplexEventChunk<StateEvent> updatingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet) throws ConnectionUnavailableException
update in class AbstractRecordTableConnectionUnavailableExceptionpublic boolean contains(StateEvent matchingEvent, CompiledCondition compiledCondition) throws ConnectionUnavailableException
contains in class AbstractRecordTableConnectionUnavailableExceptionpublic void updateOrAdd(ComplexEventChunk<StateEvent> updateOrAddingEventChunk, CompiledCondition compiledCondition, CompiledUpdateSet compiledUpdateSet, AddingStreamEventExtractor addingStreamEventExtractor) throws ConnectionUnavailableException
updateOrAdd in class AbstractRecordTableConnectionUnavailableExceptionpublic StreamEvent find(CompiledCondition compiledCondition, StateEvent matchingEvent) throws ConnectionUnavailableException
find in class AbstractRecordTableConnectionUnavailableExceptionpublic CompiledUpdateSet compileUpdateSet(io.siddhi.query.api.execution.query.output.stream.UpdateSet updateSet, MatchingMetaInfoHolder matchingMetaInfoHolder, List<VariableExpressionExecutor> variableExpressionExecutors, Map<String,Table> tableMap, SiddhiQueryContext siddhiQueryContext)
TablecompileUpdateSet in class AbstractRecordTableupdateSet - 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)
FindableProcessorcompileCondition in interface FindableProcessorcompileCondition in class AbstractRecordTablecondition - 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
QueryableProcessorquery in interface QueryableProcessormatchingEvent - 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.ConnectionUnavailableExceptionprotected 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 formatConnectionUnavailableExceptionpublic 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)
QueryableProcessorcompileSelection in interface QueryableProcessorselector - 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 © 2020. All rights reserved.