CreateSourceFactory¶
Creating Instance¶
CreateSourceFactory
takes the following to be created:
- ServiceContext
-
keySerdeFeaturesSupplier
-
valueSerdeFeaturesSupplier
-
KeySerdeFactory
- ValueSerdeFactory
- MetaStore
CreateSourceFactory
is created alongside a CommandFactories.
ValueSerdeFactory¶
CreateSourceFactory
is given a ValueSerdeFactory when created.
The ValueSerdeFactory
is used in validateSerdesCanHandleSchemas.
Creating CreateStreamCommand¶
createStreamCommand
can create a CreateStreamCommand for a CreateStream statement or a KsqlStructuredDataOutputNode.
CreateStream¶
CreateStreamCommand createStreamCommand(
CreateStream statement,
KsqlConfig ksqlConfig)
createStreamCommand
ensureTopicExists, buildSchema and buildTimestampColumn.
createStreamCommand
requests the MetaStore for the DataSource for the given CreateStream.
createStreamCommand
throwIfCreateOrReplaceOnSourceStreamOrTable.
In the end, createStreamCommand
creates a CreateStreamCommand.
createStreamCommand
is used when:
CommandFactories
is requested to handle a CreateStream DDL statement
KsqlStructuredDataOutputNode¶
CreateStreamCommand createStreamCommand(
KsqlStructuredDataOutputNode outputNode)
createStreamCommand
creates a CreateStreamCommand for the given KsqlStructuredDataOutputNode (with the isSource flag disabled).
createStreamCommand
is used when:
CommandFactories
is requested to create
Creating CreateTableCommand¶
CreateTableCommand createTableCommand(
CreateTable statement,
KsqlConfig ksqlConfig)
createTableCommand
...FIXME
createTableCommand
is used when:
CommandFactories
is requested to handle a CreateTable DDL statement
throwIfCreateOrReplaceOnSourceStreamOrTable¶
void throwIfCreateOrReplaceOnSourceStreamOrTable(
CreateSource createSource,
DataSource existingSource)
throwIfCreateOrReplaceOnSourceStreamOrTable
throws a KsqlException
when the given CreateSource is as follows:
- CREATE OR REPLACE
- SOURCE or the given DataSource is a source
Cannot add [stream|table] '[source-name]':
CREATE OR REPLACE is not supported on source [stream|table]s.
throwIfCreateOrReplaceOnSourceStreamOrTable
is used when:
CreateSourceFactory
is requested for CreateStreamCommand and CreateTableCommand DDL commands
buildFormats¶
Formats buildFormats(
SourceName name,
LogicalSchema schema,
CreateSourceProperties props,
KsqlConfig ksqlConfig)
buildFormats
...FIXME
buildFormats
is used when:
CreateSourceFactory
is requested for a CreateStreamCommand and CreateTableCommand