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 aCatalogStore
instance and the necessary information for creating and initializingCatalog
instances, including aCatalogStoreFactory
, aReadableConfig
instance, and aClassLoader
instance. This class provides automatic resource management using theAutoCloseable
interface, ensuring that the catalog-related resources are properly closed and released when they are no longer needed.A
CatalogStoreFactory
may create multipleCatalogStore
instances, which can be useful in SQL gateway scenarios where different sessions may use different catalog stores. However, in some scenarios, a singleCatalogStore
instance may be sufficient, in which case theCatalogStoreFactory
can be stored in the holder to ensure that it is properly closed when theCatalogStore
is closed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CatalogStoreHolder.Builder
Builder for a fluent definition of aCatalogStoreHolder
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CatalogStore
catalogStore()
ClassLoader
classLoader()
void
close()
ReadableConfig
config()
static CatalogStoreHolder.Builder
newBuilder()
void
open()
-
-
-
Method Detail
-
newBuilder
public static CatalogStoreHolder.Builder newBuilder()
-
catalogStore
public CatalogStore catalogStore()
-
config
public ReadableConfig config()
-
classLoader
public ClassLoader classLoader()
-
open
public void open()
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-