Package org.apache.flink.table.catalog
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 aCatalogStoreinstance and the necessary information for creating and initializingCataloginstances, including aCatalogStoreFactory, aReadableConfiginstance, and aClassLoaderinstance. This class provides automatic resource management using theAutoCloseableinterface, ensuring that the catalog-related resources are properly closed and released when they are no longer needed.A
CatalogStoreFactorymay create multipleCatalogStoreinstances, which can be useful in SQL gateway scenarios where different sessions may use different catalog stores. However, in some scenarios, a singleCatalogStoreinstance may be sufficient, in which case theCatalogStoreFactorycan be stored in the holder to ensure that it is properly closed when theCatalogStoreis closed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCatalogStoreHolder.BuilderBuilder for a fluent definition of aCatalogStoreHolder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CatalogStorecatalogStore()ClassLoaderclassLoader()voidclose()org.apache.flink.configuration.ReadableConfigconfig()static CatalogStoreHolder.BuildernewBuilder()voidopen()
-
-
-
Method Detail
-
newBuilder
public static CatalogStoreHolder.Builder newBuilder()
-
catalogStore
public CatalogStore catalogStore()
-
config
public org.apache.flink.configuration.ReadableConfig config()
-
classLoader
public ClassLoader classLoader()
-
open
public void open()
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-