iceberg-cpp
Loading...
Searching...
No Matches
catalog_properties.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
22#include <string>
23#include <unordered_map>
24
26#include "iceberg/result.h"
27#include "iceberg/util/config.h"
28
31
32namespace iceberg::rest {
33
35enum class SnapshotMode : uint8_t { kAll, kRefs };
36
38class ICEBERG_REST_EXPORT RestCatalogProperties
39 : public ConfigBase<RestCatalogProperties> {
40 public:
41 template <typename T>
42 using Entry = const ConfigBase<RestCatalogProperties>::Entry<T>;
43
45 inline static Entry<std::string> kUri{"uri", ""};
47 inline static Entry<std::string> kName{"name", ""};
49 inline static Entry<std::string> kWarehouse{"warehouse", ""};
51 inline static Entry<std::string> kIOImpl{"io-impl", ""};
53 inline static Entry<std::string> kPrefix{"prefix", ""};
55 inline static Entry<std::string> kNamespaceSeparator{"namespace-separator", "%1F"};
57 inline static Entry<std::string> kSnapshotLoadingMode{"snapshot-loading-mode", "ALL"};
59 inline static Entry<std::string> kMetricsReportingEnabled{
60 "rest-metrics-reporting-enabled", "true"};
62 inline static constexpr std::string_view kHeaderPrefix = "header.";
63
66
69 std::unordered_map<std::string, std::string> properties);
70
72 std::unordered_map<std::string, std::string> ExtractHeaders() const;
73
77
83};
84
85} // namespace iceberg::rest
Definition config.h:73
Definition config.h:70
Configuration class for a REST Catalog.
Definition catalog_properties.h:39
static RestCatalogProperties default_properties()
Create a default RestCatalogProperties instance.
Result< SnapshotMode > SnapshotLoadingMode() const
Get the snapshot loading mode.
static RestCatalogProperties FromMap(std::unordered_map< std::string, std::string > properties)
Create a RestCatalogProperties instance from a map of key-value pairs.
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.
Provide typed configuration helpers.
Define symbol visibility macros for the REST catalog library.
REST catalog APIs.
Definition auth_manager.h:34
SnapshotMode
Snapshot loading mode for REST catalog.
Definition catalog_properties.h:35
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.