public final class FlinkFactoryUtil extends Object
Factorys.| Modifier and Type | Class and Description |
|---|---|
static class |
FlinkFactoryUtil.FlinkFactoryHelper<F extends LogStoreTableFactory>
Base flink helper utility for validating all options for a
LogStoreTableFactory. |
static class |
FlinkFactoryUtil.FlinkTableFactoryHelper
Helper utility for discovering formats and validating all options for a
DynamicTableFactory. |
| Modifier and Type | Field and Description |
|---|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
static FlinkFactoryUtil.FlinkTableFactoryHelper |
createFlinkTableFactoryHelper(LogStoreTableFactory factory,
org.apache.flink.table.factories.DynamicTableFactory.Context context)
Creates a utility that helps in discovering formats, merging options with
DynamicTableFactory.Context#getEnrichmentOptions() and validating them all for a LogStoreTableFactory. |
static <T extends org.apache.flink.table.factories.Factory> |
discoverFlinkFactory(ClassLoader classLoader,
Class<T> factoryClass,
String factoryIdentifier)
Discovers a flink 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.
|
public static final org.apache.flink.configuration.ConfigOption<String> FORMAT
public static final String FORMAT_SUFFIX
ConfigOption in case a connector requires multiple formats (e.g.
for both key and value).
See #createFlinkTableFactoryHelper(LogStoreTableFactory, Context) Context)} for
more information.
public static FlinkFactoryUtil.FlinkTableFactoryHelper createFlinkTableFactoryHelper(LogStoreTableFactory factory, org.apache.flink.table.factories.DynamicTableFactory.Context context)
DynamicTableFactory.Context#getEnrichmentOptions() and validating them all for a LogStoreTableFactory.
The following example sketches the usage:
// in createDynamicTableSource()
helper = FlinkFactoryUtil.createFlinkTableFactoryHelper(this, context);
keyFormat = helper.discoverDecodingFormat(DeserializationFormatFactory.class, KEY_FORMAT);
valueFormat = helper.discoverDecodingFormat(DeserializationFormatFactory.class, VALUE_FORMAT);
helper.validate();
... // construct connector with discovered formats
public static <T extends org.apache.flink.table.factories.Factory> T discoverFlinkFactory(ClassLoader classLoader, Class<T> factoryClass, String factoryIdentifier)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.