QueryRegistry¶
QueryRegistry
is an abstraction of query registries for building and managing queries.
Contract (Subset)¶
createOrReplacePersistentQuery¶
PersistentQueryMetadata createOrReplacePersistentQuery(
SessionConfig config,
ServiceContext serviceContext,
ProcessingLogContext processingLogContext,
MetaStore metaStore,
String statementText,
QueryId queryId,
Optional<DataSource> sinkDataSource,
Set<DataSource> sources,
ExecutionStep<?> physicalPlan,
String planSummary,
KsqlConstants.PersistentQueryType persistentQueryType,
Optional<String> sharedRuntimeId)
See QueryRegistryImpl.createOrReplacePersistentQuery
Used when:
EngineExecutor
is requested to execute a persistent query
Creating Stream Pull Query¶
TransientQueryMetadata createStreamPullQuery(
SessionConfig config,
ServiceContext serviceContext,
ProcessingLogContext processingLogContext,
MetaStore metaStore,
String statementText,
QueryId queryId,
Set<SourceName> sources,
ExecutionStep<?> physicalPlan,
String planSummary,
LogicalSchema schema,
OptionalInt limit,
Optional<WindowInfo> windowInfo,
boolean excludeTombstones,
ImmutableMap<TopicPartition, Long> endOffsets)
Note
createStreamPullQuery
is createTransientQuery with endOffsets
.
See QueryRegistryImpl.createStreamPullQuery
Used when:
EngineExecutor
is requested to executeStreamPullQuery
createTransientQuery¶
TransientQueryMetadata createTransientQuery(
SessionConfig config,
ServiceContext serviceContext,
ProcessingLogContext processingLogContext,
MetaStore metaStore,
String statementText,
QueryId queryId,
Set<SourceName> sources,
ExecutionStep<?> physicalPlan,
String planSummary,
LogicalSchema schema,
OptionalInt limit,
Optional<WindowInfo> windowInfo,
boolean excludeTombstones)
Note
createTransientQuery
is createStreamPullQuery with no endOffsets
.
See QueryRegistryImpl.createTransientQuery
Used when:
EngineExecutor
is requested to executeTransientQuery
getAllLiveQueries¶
List<QueryMetadata> getAllLiveQueries()
All active queries (QueryMetadata)
See QueryRegistryImpl.getAllLiveQueries
Used when:
EngineExecutor
is requested to executeTransientQuery, executeStreamPullQuery, sourceTablePlan, plan a statementKsqlEngine
is requested to getAllLiveQueriesSandboxedExecutionContext
is requested to getAllLiveQueriesTransientQueryCleanupService
is requested toisCorrespondingQueryTerminated
QueryRegistryImpl
is requested to close live queries
updateStreamsPropertiesAndRestartRuntime¶
void updateStreamsPropertiesAndRestartRuntime(
KsqlConfig config,
ProcessingLogContext logContext)
See QueryRegistryImpl.updateStreamsPropertiesAndRestartRuntime
Used when:
KsqlEngine
is requested to updateStreamsPropertiesAndRestartRuntime