Package org.apache.flink.table.factories
Class ApiFactoryUtil
- java.lang.Object
-
- org.apache.flink.table.factories.ApiFactoryUtil
-
@Internal public class ApiFactoryUtil extends Object
Utility for dealing with catalog store factories.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classApiFactoryUtil.CatalogStoreResultResult holder for catalog store and factory.static classApiFactoryUtil.SecretStoreResultResult holder for secret store and factory.
-
Constructor Summary
Constructors Constructor Description ApiFactoryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.flink.table.factories.CatalogStoreFactory.ContextbuildCatalogStoreFactoryContext(org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)Build aCatalogStoreFactory.Contextfor opening theCatalogStoreFactory.static org.apache.flink.table.factories.CatalogStoreFactoryfindAndCreateCatalogStoreFactory(org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)Finds and creates aCatalogStoreFactoryusing the providedConfigurationand user classloader.static ApiFactoryUtil.CatalogStoreResultgetOrCreateCatalogStore(Optional<org.apache.flink.table.catalog.CatalogStore> providedCatalogStore, org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)Gets or creates aCatalogStore.static ApiFactoryUtil.SecretStoreResultgetOrCreateSecretStore(Optional<org.apache.flink.table.secret.SecretStore> providedSecretStore, org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)Gets or creates aSecretStore.
-
-
-
Method Detail
-
getOrCreateCatalogStore
public static ApiFactoryUtil.CatalogStoreResult getOrCreateCatalogStore(Optional<org.apache.flink.table.catalog.CatalogStore> providedCatalogStore, org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)
Gets or creates aCatalogStore. If a catalog store is provided in settings, it will be used directly. Otherwise, a new catalog store will be created using the factory.- Parameters:
providedCatalogStore- the catalog store from settings, if presentconfiguration- the configurationclassLoader- the user classloader- Returns:
- a result containing the catalog store and factory (factory is null if store was provided)
-
findAndCreateCatalogStoreFactory
public static org.apache.flink.table.factories.CatalogStoreFactory findAndCreateCatalogStoreFactory(org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)Finds and creates aCatalogStoreFactoryusing the providedConfigurationand user classloader.The configuration format should be as follows:
table.catalog-store.kind: {identifier} table.catalog-store.{identifier}.{param1}: xxx table.catalog-store.{identifier}.{param2}: xxx
-
buildCatalogStoreFactoryContext
public static org.apache.flink.table.factories.CatalogStoreFactory.Context buildCatalogStoreFactoryContext(org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)Build aCatalogStoreFactory.Contextfor opening theCatalogStoreFactory.The configuration format should be as follows:
table.catalog-store.kind: {identifier} table.catalog-store.{identifier}.{param1}: xxx table.catalog-store.{identifier}.{param2}: xxx
-
getOrCreateSecretStore
public static ApiFactoryUtil.SecretStoreResult getOrCreateSecretStore(Optional<org.apache.flink.table.secret.SecretStore> providedSecretStore, org.apache.flink.configuration.Configuration configuration, ClassLoader classLoader)
Gets or creates aSecretStore. If a secret store is provided in settings, it will be used directly. Otherwise, a new secret store will be created using the factory.- Parameters:
providedSecretStore- the secret store from settings, if presentconfiguration- the configurationclassLoader- the user classloader- Returns:
- a result containing the secret store and factory (factory is null if store was provided)
-
-