Interface Factory
- All Known Subinterfaces:
CatalogFactory,CatalogStoreFactory,DecodingFormatFactory<I>,DeserializationFormatFactory,DynamicTableFactory,DynamicTableSinkFactory,DynamicTableSourceFactory,EncodingFormatFactory<I>,FormatFactory,ModuleFactory,SerializationFormatFactory,WorkflowSchedulerFactory
- All Known Implementing Classes:
CoreModuleFactory
A factory is uniquely identified by Class and factoryIdentifier().
The list of available factories is discovered using Java's Service Provider Interfaces (SPI).
Classes that implement this interface can be added to
META_INF/services/org.apache.flink.table.factories.Factory in JAR files.
Every factory declares a set of required and optional options. This information will not be used during discovery but is helpful when generating documentation and performing validation. A factory may discover further (nested) factories, the options of the nested factories must not be declared in the sets of this factory.
It is the responsibility of each factory to perform validation before returning an instance.
For consistency, the following style for key names of ConfigOption is recommended:
- Try to reuse key names as much as possible. Use other factory implementations as an example.
- Key names should be declared in lower case. Use "-" instead of dots or camel case to split words.
- Key names should be hierarchical where appropriate. Think about how one would define
such a hierarchy in JSON or YAML file (e.g.
sink.bulk-flush.max-actions). - In case of a hierarchy, try not to use the higher level again in the key name (e.g. do
sink.partitionerinstead ofsink.sink-partitioner) to keep the keys short. - Key names which can be templated, e.g. to refer to a specific column, should be listed
using '#' as the placeholder symbol. For example, use
fields.#.min.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a unique identifier among same factory interfaces.Set<org.apache.flink.configuration.ConfigOption<?>>Returns a set ofConfigOptionthat an implementation of this factory consumes in addition torequiredOptions().Set<org.apache.flink.configuration.ConfigOption<?>>Returns a set ofConfigOptionthat an implementation of this factory requires in addition tooptionalOptions().
-
Method Details
-
factoryIdentifier
String factoryIdentifier()Returns a unique identifier among same factory interfaces.For consistency, an identifier should be declared as one lower case word (e.g.
kafka). If multiple factories exist for different versions, a version should be appended using "-" (e.g.elasticsearch-7). -
requiredOptions
Set<org.apache.flink.configuration.ConfigOption<?>> requiredOptions()Returns a set ofConfigOptionthat an implementation of this factory requires in addition tooptionalOptions().See the documentation of
Factoryfor more information. -
optionalOptions
Set<org.apache.flink.configuration.ConfigOption<?>> optionalOptions()Returns a set ofConfigOptionthat an implementation of this factory consumes in addition torequiredOptions().See the documentation of
Factoryfor more information.
-