@PublicEvolving public interface Factory
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:
sink.bulk-flush.max-actions
).
sink.partitioner
instead of sink.sink-partitioner
) to keep the keys
short.
Modifier and Type | Method and Description |
---|---|
String |
factoryIdentifier()
Returns a unique identifier among same factory interfaces.
|
Set<ConfigOption<?>> |
optionalOptions()
Returns a set of
ConfigOption that an implementation of this factory consumes in
addition to requiredOptions() . |
Set<ConfigOption<?>> |
requiredOptions()
Returns a set of
ConfigOption that an implementation of this factory requires in
addition to optionalOptions() . |
String factoryIdentifier()
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. kafka-0.10
).
Set<ConfigOption<?>> requiredOptions()
ConfigOption
that an implementation of this factory requires in
addition to optionalOptions()
.
See the documentation of Factory
for more information.
Set<ConfigOption<?>> optionalOptions()
ConfigOption
that an implementation of this factory consumes in
addition to requiredOptions()
.
See the documentation of Factory
for more information.
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.