iceberg-cpp
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
iceberg::rest::RestCatalog Class Referencefinal

Session-aware REST catalog root. More...

#include <rest_catalog.h>

Inheritance diagram for iceberg::rest::RestCatalog:
iceberg::SessionCatalog

Public Types

using ClientFactory = std::function< Result< std::shared_ptr< HttpClient > >(const RestCatalogProperties &)>
 

Public Member Functions

 RestCatalog (const RestCatalog &)=delete
 
RestCatalog & operator= (const RestCatalog &)=delete
 
 RestCatalog (RestCatalog &&)=delete
 
RestCatalog & operator= (RestCatalog &&)=delete
 
std::string_view name () const override
 Catalog name.
 
Result< std::shared_ptr< Catalog > > AsCatalog () override
 Return a Catalog view bound to the catalog's default session.
 
Result< std::shared_ptr< Catalog > > WithContext (SessionContext context) override
 Return a Catalog view bound to the supplied session context.
 

Static Public Member Functions

static Result< std::shared_ptr< RestCatalog > > Make (const RestCatalogProperties &config, ClientFactory client_factory={}, Executor *auth_executor=nullptr, Executor *metrics_executor=nullptr)
 Create a RestCatalog instance.
 

Detailed Description

Session-aware REST catalog root.

Member Function Documentation

◆ AsCatalog()

Result< std::shared_ptr< Catalog > > iceberg::rest::RestCatalog::AsCatalog ( )
overridevirtual

Return a Catalog view bound to the catalog's default session.

Implementations may cache and return the same default catalog view on repeated calls.

Implements iceberg::SessionCatalog.

◆ Make()

static Result< std::shared_ptr< RestCatalog > > iceberg::rest::RestCatalog::Make ( const RestCatalogProperties &  config,
ClientFactory  client_factory = {},
Executor *  auth_executor = nullptr,
Executor *  metrics_executor = nullptr 
)
static

Create a RestCatalog instance.

Parameters
client_factoryOptional HTTP client factory, called with the initial config and then the merged server config. It should configure the HTTP client's base URI from the supplied properties. When empty, uses the default HTTP client.
auth_executorBorrowed OAuth2 refresh executor. With OAuth2 credentials, token-refresh-enabled=true (default) requires it; null returns InvalidArgument. Must enqueue asynchronously and outlive the catalog, its auth sessions and their tasks.
metrics_executorOptional non-owning executor for asynchronous REST metrics. It must outlive the catalog and all tables created by it. When null, REST metrics are reported synchronously.

◆ name()

std::string_view iceberg::rest::RestCatalog::name ( ) const
overridevirtual

Catalog name.

Implements iceberg::SessionCatalog.

◆ WithContext()

Result< std::shared_ptr< Catalog > > iceberg::rest::RestCatalog::WithContext ( SessionContext  context)
overridevirtual

Return a Catalog view bound to the supplied session context.

Implementations should reject invalid contexts, such as an empty SessionContext::session_id. Returned catalog views use the normal Catalog interface for all table and namespace operations.

Implements iceberg::SessionCatalog.


The documentation for this class was generated from the following file: