QueryEndpoint¶
QueryEndpoint
is used to create a QueryPublisher for KsqlServerEndpoints.
Creating Instance¶
QueryEndpoint
takes the following to be created:
- KsqlEngine
- KsqlConfig
-
PullQueryExecutorMetrics
- QueryExecutor
QueryEndpoint
is created when:
KsqlServerEndpoints
is requested to createQueryPublisher
KsqlEngine¶
QueryEndpoint
is given a KsqlEngine when created.
The KsqlEngine
is used when configuring a query statement (to parse and prepare a KSQL query statement).
QueryExecutor¶
QueryEndpoint
is given a QueryExecutor when created.
The QueryExecutor
is used for createQueryPublisher (to handle a configured KSQL query statement).
Creating QueryPublisher¶
QueryPublisher createQueryPublisher(
String sql,
Map<String, Object> properties,
Map<String, Object> sessionVariables,
Map<String, Object> requestProperties,
Context context,
WorkerExecutor workerExecutor,
ServiceContext serviceContext,
MetricsCallbackHolder metricsCallbackHolder,
Optional<Boolean> isInternalRequest)
createQueryPublisher
creates a ConfiguredStatement for the given sql
(that is expected to be a Query statement).
createQueryPublisher
requests the QueryExecutor to handle the query statement.
For a pull query result, createQueryPublisher
creates a BlockingQueryPublisher to setQueryHandle with a new KsqlPullQueryHandle
and the flags:
isPullQuery
enabledisScalablePushQuery
disabled
For a push query result, createQueryPublisher
creates a BlockingQueryPublisher to setQueryHandle with a new KsqlQueryHandle
and the flags:
isPullQuery
disabledisScalablePushQuery
based on whetherQueryMetadataHolder
holds aScalablePushQueryMetadata
or not
Otherwise, createQueryPublisher
throws an KsqlStatementException
:
Unexpected metadata for query
createQueryPublisher
is used when:
KsqlServerEndpoints
is requested to createQueryPublisher