@Internal public class CatalogStoreHolder extends Object implements AutoCloseable
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.
Modifier and Type | Class and Description |
---|---|
static class |
CatalogStoreHolder.Builder
Builder for a fluent definition of a
CatalogStoreHolder . |
Modifier and Type | Method and Description |
---|---|
CatalogStore |
catalogStore() |
ClassLoader |
classLoader() |
void |
close() |
ReadableConfig |
config() |
static CatalogStoreHolder.Builder |
newBuilder() |
void |
open() |
public static CatalogStoreHolder.Builder newBuilder()
public CatalogStore catalogStore()
public ReadableConfig config()
public ClassLoader classLoader()
public void open()
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.