| 限定符和类型 | 类和说明 |
|---|---|
static class |
FactoryUtil.CatalogFactoryHelper
Helper utility for validating all options for a
CatalogFactory. |
static class |
FactoryUtil.DefaultCatalogContext
Default implementation of
CatalogFactory.Context. |
static class |
FactoryUtil.DefaultDynamicTableContext
Default implementation of
DynamicTableFactory.Context. |
static class |
FactoryUtil.DefaultModuleContext
Default implementation of
ModuleFactory.Context. |
static class |
FactoryUtil.ModuleFactoryHelper
Helper utility for validating all options for a
ModuleFactory. |
static class |
FactoryUtil.TableFactoryHelper
Helper utility for discovering formats and validating all options for a
DynamicTableFactory. |
| 限定符和类型 | 字段和说明 |
|---|---|
static org.apache.flink.configuration.ConfigOption<String> |
CONNECTOR |
static org.apache.flink.configuration.ConfigOption<String> |
FORMAT |
static String |
FORMAT_SUFFIX
Suffix for keys of
ConfigOption in case a connector requires multiple formats (e.g. |
static String |
PLACEHOLDER_SYMBOL
The placeholder symbol to be used for keys of options which can be templated.
|
static org.apache.flink.configuration.ConfigOption<Integer> |
PROPERTY_VERSION
Describes the property version.
|
static org.apache.flink.configuration.ConfigOption<Integer> |
SINK_PARALLELISM |
| 限定符和类型 | 方法和说明 |
|---|---|
static Catalog |
createCatalog(String catalogName,
Map<String,String> options,
org.apache.flink.configuration.ReadableConfig configuration,
ClassLoader classLoader)
Attempts to discover an appropriate catalog factory and creates an instance of the catalog.
|
static FactoryUtil.CatalogFactoryHelper |
createCatalogFactoryHelper(CatalogFactory factory,
CatalogFactory.Context context)
Creates a utility that helps validating options for a
CatalogFactory. |
static Module |
createModule(String moduleName,
Map<String,String> options,
org.apache.flink.configuration.ReadableConfig configuration,
ClassLoader classLoader)
Discovers a matching module factory and creates an instance of it.
|
static FactoryUtil.ModuleFactoryHelper |
createModuleFactoryHelper(ModuleFactory factory,
ModuleFactory.Context context)
Creates a utility that helps validating options for a
ModuleFactory. |
static FactoryUtil.TableFactoryHelper |
createTableFactoryHelper(DynamicTableFactory factory,
DynamicTableFactory.Context context)
Creates a utility that helps in discovering formats and validating all options for a
DynamicTableFactory. |
static DynamicTableSink |
createTableSink(Catalog catalog,
ObjectIdentifier objectIdentifier,
ResolvedCatalogTable catalogTable,
org.apache.flink.configuration.ReadableConfig configuration,
ClassLoader classLoader,
boolean isTemporary)
Creates a
DynamicTableSink from a CatalogTable. |
static DynamicTableSource |
createTableSource(Catalog catalog,
ObjectIdentifier objectIdentifier,
ResolvedCatalogTable catalogTable,
org.apache.flink.configuration.ReadableConfig configuration,
ClassLoader classLoader,
boolean isTemporary)
Creates a
DynamicTableSource from a CatalogTable. |
static <T extends Factory> |
discoverFactory(ClassLoader classLoader,
Class<T> factoryClass,
String factoryIdentifier)
Discovers a factory using the given factory base class and identifier.
|
static String |
getFormatPrefix(org.apache.flink.configuration.ConfigOption<String> formatOption,
String formatIdentifier)
Returns the required option prefix for options of the given format.
|
static void |
validateFactoryOptions(Factory factory,
org.apache.flink.configuration.ReadableConfig options)
Validates the required and optional
ConfigOptions of a factory. |
static void |
validateFactoryOptions(Set<org.apache.flink.configuration.ConfigOption<?>> requiredOptions,
Set<org.apache.flink.configuration.ConfigOption<?>> optionalOptions,
org.apache.flink.configuration.ReadableConfig options)
Validates the required options and optional options.
|
static void |
validateUnconsumedKeys(String factoryIdentifier,
Set<String> allOptionKeys,
Set<String> consumedOptionKeys)
Validates unconsumed option keys.
|
static void |
validateUnconsumedKeys(String factoryIdentifier,
Set<String> allOptionKeys,
Set<String> consumedOptionKeys,
Set<String> deprecatedOptionKeys)
Validates unconsumed option keys.
|
public static final org.apache.flink.configuration.ConfigOption<Integer> PROPERTY_VERSION
public static final org.apache.flink.configuration.ConfigOption<String> CONNECTOR
public static final org.apache.flink.configuration.ConfigOption<String> FORMAT
public static final org.apache.flink.configuration.ConfigOption<Integer> SINK_PARALLELISM
public static final String FORMAT_SUFFIX
ConfigOption in case a connector requires multiple formats (e.g.
for both key and value).
See createTableFactoryHelper(DynamicTableFactory, DynamicTableFactory.Context)
for more information.
public static DynamicTableSource createTableSource(@Nullable Catalog catalog, ObjectIdentifier objectIdentifier, ResolvedCatalogTable catalogTable, org.apache.flink.configuration.ReadableConfig configuration, ClassLoader classLoader, boolean isTemporary)
public static DynamicTableSink createTableSink(@Nullable Catalog catalog, ObjectIdentifier objectIdentifier, ResolvedCatalogTable catalogTable, org.apache.flink.configuration.ReadableConfig configuration, ClassLoader classLoader, boolean isTemporary)
public static FactoryUtil.CatalogFactoryHelper createCatalogFactoryHelper(CatalogFactory factory, CatalogFactory.Context context)
CatalogFactory.
Note: This utility checks for left-over options in the final step.
public static FactoryUtil.ModuleFactoryHelper createModuleFactoryHelper(ModuleFactory factory, ModuleFactory.Context context)
ModuleFactory.
Note: This utility checks for left-over options in the final step.
public static FactoryUtil.TableFactoryHelper createTableFactoryHelper(DynamicTableFactory factory, DynamicTableFactory.Context context)
DynamicTableFactory.
The following example sketches the usage:
// in createDynamicTableSource()
helper = FactoryUtil.createTableFactoryHelper(this, context);
keyFormat = helper.discoverDecodingFormat(DeserializationFormatFactory.class, KEY_FORMAT);
valueFormat = helper.discoverDecodingFormat(DeserializationFormatFactory.class, VALUE_FORMAT);
helper.validate();
... // construct connector with discovered formats
Note: The format option parameter of FactoryUtil.TableFactoryHelper.discoverEncodingFormat(Class, ConfigOption) and FactoryUtil.TableFactoryHelper.discoverDecodingFormat(Class, ConfigOption) must be FORMAT or
end with FORMAT_SUFFIX. The discovery logic will replace 'format' with the factory
identifier value as the format prefix. For example, assuming the identifier is 'json', if the
format option key is 'format', then the format prefix is 'json.'. If the format option key is
'value.format', then the format prefix is 'value.json'. The format prefix is used to project
the options for the format factory.
Note: This utility checks for left-over options in the final step.
public static Catalog createCatalog(String catalogName, Map<String,String> options, org.apache.flink.configuration.ReadableConfig configuration, ClassLoader classLoader)
This first uses the legacy TableFactory stack to discover a matching CatalogFactory. If none is found, it falls back to the new stack using Factory
instead.
public static Module createModule(String moduleName, Map<String,String> options, org.apache.flink.configuration.ReadableConfig configuration, ClassLoader classLoader)
This first uses the legacy TableFactory stack to discover a matching ModuleFactory. If none is found, it falls back to the new stack using Factory
instead.
public static <T extends Factory> T discoverFactory(ClassLoader classLoader, Class<T> factoryClass, String factoryIdentifier)
This method is meant for cases where createTableFactoryHelper(DynamicTableFactory,
DynamicTableFactory.Context) createTableSource(Catalog, ObjectIdentifier,
ResolvedCatalogTable, ReadableConfig, ClassLoader, boolean), and createTableSink(Catalog, ObjectIdentifier, ResolvedCatalogTable, ReadableConfig,
ClassLoader, boolean) are not applicable.
public static void validateFactoryOptions(Factory factory, org.apache.flink.configuration.ReadableConfig options)
ConfigOptions of a factory.
Note: It does not check for left-over options.
public static void validateFactoryOptions(Set<org.apache.flink.configuration.ConfigOption<?>> requiredOptions, Set<org.apache.flink.configuration.ConfigOption<?>> optionalOptions, org.apache.flink.configuration.ReadableConfig options)
Note: It does not check for left-over options.
public static void validateUnconsumedKeys(String factoryIdentifier, Set<String> allOptionKeys, Set<String> consumedOptionKeys, Set<String> deprecatedOptionKeys)
public static void validateUnconsumedKeys(String factoryIdentifier, Set<String> allOptionKeys, Set<String> consumedOptionKeys)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.