SandboxedExecutionContext¶
SandboxedExecutionContext
is a KsqlExecutionContext for executing SQL statements without affecting the state of the system (i.e. no changes to the core engine's state nor the state of external services).
Creating Instance¶
SandboxedExecutionContext
takes the following to be created:
- EngineContext
- ServiceContext
-
MetricCollectors
SandboxedExecutionContext
is created when:
KsqlEngine
is requested to create a sandboxed execution contextSandboxedExecutionContext
is requested to create a sandboxed execution context
SandboxedExecutionContext
is a KsqlExecutionContext
and part of the abstraction is to create a SandboxedExecutionContext. This is exactly SandboxedExecutionContext
itself by default.
That's why instances of SandboxedExecutionContext
s are created indirectly via KsqlExecutionContext.
EngineContext¶
While being created, SandboxedExecutionContext
requests the given source EngineContext to create a sandboxed EngineContext.
Statement Planning (plan)¶
KsqlPlan plan(
ServiceContext serviceContext,
ConfiguredStatement<?> statement)
plan
is part of the KsqlExecutionContext abstraction.
plan
creates an EngineExecutor to plan the given ConfiguredStatement
.
Executing Statement¶
ExecuteResult execute(
ServiceContext serviceContext,
ConfiguredStatement<?> statement) // (1)!
ExecuteResult execute(
ServiceContext serviceContext,
ConfiguredKsqlPlan plan)
- Plans the statement and creates a
ConfiguredKsqlPlan
for the otherexecute
execute
creates an EngineExecutor to execute the KsqlPlan (of the ConfiguredKsqlPlan
) and produce an ExecuteResult
.
execute
requests the ExecuteResult
for the QueryMetadata and get the KafkaStreams client that is closed right after.
In the end, execute
returns the ExecuteResult
.
execute
is part of the KsqlExecutionContext abstraction.
Executing Transient Query¶
TransientQueryMetadata executeTransientQuery(
ServiceContext serviceContext,
ConfiguredStatement<Query> statement,
boolean excludeTombstones)
executeTransientQuery
creates an EngineExecutor to executeTransientQuery.
executeTransientQuery
is part of the KsqlExecutionContext abstraction.