Class ApiFactoryUtil


  • @Internal
    public class ApiFactoryUtil
    extends Object
    Utility for dealing with catalog store factories.
    • Constructor Detail

      • ApiFactoryUtil

        public ApiFactoryUtil()
    • 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 a CatalogStore. 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 present
        configuration - the configuration
        classLoader - 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 a CatalogStoreFactory using the provided Configuration and 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 a CatalogStoreFactory.Context for opening the CatalogStoreFactory.

        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 a SecretStore. 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 present
        configuration - the configuration
        classLoader - the user classloader
        Returns:
        a result containing the secret store and factory (factory is null if store was provided)