Class CatalogStoreHolder

java.lang.Object
org.apache.flink.table.catalog.CatalogStoreHolder
All Implemented Interfaces:
AutoCloseable

@Internal public class CatalogStoreHolder extends Object implements AutoCloseable
A holder for a CatalogStore instance and the necessary information for creating and initializing Catalog instances, including a CatalogStoreFactory, a ReadableConfig instance, and a ClassLoader instance. This class provides automatic resource management using the AutoCloseable interface, ensuring that the catalog-related resources are properly closed and released when they are no longer needed.

A CatalogStoreFactory may create multiple CatalogStore instances, which can be useful in SQL gateway scenarios where different sessions may use different catalog stores. However, in some scenarios, a single CatalogStore instance may be sufficient, in which case the CatalogStoreFactory can be stored in the holder to ensure that it is properly closed when the CatalogStore is closed.