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

Configuration class for a REST Catalog. More...

#include <catalog_properties.h>

Inheritance diagram for iceberg::rest::RestCatalogProperties:
iceberg::ConfigBase< RestCatalogProperties >

Public Types

template<typename T >
using Entry = const ConfigBase< RestCatalogProperties >::Entry< T >
 

Public Member Functions

std::unordered_map< std::string, std::string > ExtractHeaders () const
 Returns HTTP headers to be added to every request.
 
Result< std::string_view > Uri () const
 Get the URI of the REST catalog server.
 
Result< SnapshotMode > SnapshotLoadingMode () const
 Get the snapshot loading mode.
 
- Public Member Functions inherited from iceberg::ConfigBase< RestCatalogProperties >
ConfigBase & Set (const Entry< T > &entry, const T &val)
 
ConfigBase & Unset (const Entry< T > &entry)
 
ConfigBase & Reset ()
 
T Get (const Entry< T > &entry) const
 
const std::unordered_map< std::string, std::string > & configs () const
 
std::unordered_map< std::string, std::string > & mutable_configs ()
 
std::unordered_map< std::string, std::string > Extract (std::string_view prefix) const
 Extracts the prefix from the configuration.
 

Static Public Member Functions

static RestCatalogProperties default_properties ()
 Create a default RestCatalogProperties instance.
 
static RestCatalogProperties FromMap (std::unordered_map< std::string, std::string > properties)
 Create a RestCatalogProperties instance from a map of key-value pairs.
 
static Result< std::optional< ScanPlanningMode > > ScanPlanningModeFrom (const std::unordered_map< std::string, std::string > &config)
 Get the scan planning mode from the given config map, returning std::nullopt if the key is absent.
 

Static Public Attributes

static Entry< std::string > kUri {"uri", ""}
 The URI of the REST catalog server.
 
static Entry< std::string > kName {"name", ""}
 The name of the catalog.
 
static Entry< std::string > kWarehouse {"warehouse", ""}
 The warehouse path.
 
static Entry< std::string > kIOImpl {"io-impl", ""}
 The FileIO implementation name.
 
static Entry< std::string > kPrefix {"prefix", ""}
 The optional prefix for REST API paths.
 
static Entry< std::string > kNamespaceSeparator {"namespace-separator", "%1F"}
 The encoded separator used to join namespace levels in REST paths.
 
static Entry< std::string > kSnapshotLoadingMode {"snapshot-loading-mode", "ALL"}
 The snapshot loading mode (ALL or REFS).
 
static Entry< std::string > kMetricsReportingEnabled
 Whether to report metrics to the REST catalog server (default: true).
 
static Entry< std::string > kScanPlanningMode {"scan-planning-mode", "client"}
 The scan planning mode (client or server).
 
static Entry< int64_t > kScanPlanningPollTimeoutMs
 Maximum time to wait for a submitted scan plan, in milliseconds.
 
static Entry< int32_t > kScanPlanningPollNumRetries
 Extra polls after the first fetch of a submitted scan plan.
 
static constexpr std::string_view kHeaderPrefix = "header."
 The prefix for HTTP headers.
 
static Entry< int64_t > kClientConnectionTimeoutMs
 HTTP connection timeout in milliseconds, matching Java REST clients.
 
static Entry< int64_t > kClientSocketTimeoutMs {"rest.client.socket-timeout-ms", 0}
 HTTP socket/read timeout in milliseconds, matching Java REST clients.
 
static Entry< bool > kTrustServerOAuth2Uri
 Whether server configuration may select the OAuth2 token endpoint. When false, the client must explicitly configure an absolute http:// or https:// oauth2-server-uri. This setting is read from client configuration only.
 

Additional Inherited Members

- Protected Attributes inherited from iceberg::ConfigBase< RestCatalogProperties >
std::unordered_map< std::string, std::string > configs_
 

Detailed Description

Configuration class for a REST Catalog.

Member Function Documentation

◆ SnapshotLoadingMode()

Result< SnapshotMode > iceberg::rest::RestCatalogProperties::SnapshotLoadingMode ( ) const

Get the snapshot loading mode.

Returns
SnapshotMode::kAll if configured as "ALL", SnapshotMode::kRefs if "REFS", or an error if the value is invalid. Parsing is case-insensitive to match Java behavior.

◆ Uri()

Result< std::string_view > iceberg::rest::RestCatalogProperties::Uri ( ) const

Get the URI of the REST catalog server.

Returns
The URI if configured, or an error if not set or empty.

Member Data Documentation

◆ kClientConnectionTimeoutMs

Entry<int64_t> iceberg::rest::RestCatalogProperties::kClientConnectionTimeoutMs
inlinestatic
Initial value:
{
"rest.client.connection-timeout-ms", 0}

HTTP connection timeout in milliseconds, matching Java REST clients.

◆ kMetricsReportingEnabled

Entry<std::string> iceberg::rest::RestCatalogProperties::kMetricsReportingEnabled
inlinestatic
Initial value:
{
"rest-metrics-reporting-enabled", "true"}

Whether to report metrics to the REST catalog server (default: true).

◆ kScanPlanningPollNumRetries

Entry<int32_t> iceberg::rest::RestCatalogProperties::kScanPlanningPollNumRetries
inlinestatic
Initial value:
{
"rest-scan-planning.poll-num-retries", 10}

Extra polls after the first fetch of a submitted scan plan.

◆ kScanPlanningPollTimeoutMs

Entry<int64_t> iceberg::rest::RestCatalogProperties::kScanPlanningPollTimeoutMs
inlinestatic
Initial value:
{
"rest-scan-planning.poll-timeout-ms", 300000}

Maximum time to wait for a submitted scan plan, in milliseconds.

◆ kTrustServerOAuth2Uri

Entry<bool> iceberg::rest::RestCatalogProperties::kTrustServerOAuth2Uri
inlinestatic
Initial value:
{"rest.auth.oauth2.trust-server-uri",
true}

Whether server configuration may select the OAuth2 token endpoint. When false, the client must explicitly configure an absolute http:// or https:// oauth2-server-uri. This setting is read from client configuration only.


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