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
25#include "iceberg/catalog/rest/iceberg_rest_export.h"
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 constexpr std::string_view kHeaderPrefix = "header.";
60
62 static RestCatalogProperties default_properties();
63
65 static RestCatalogProperties FromMap(
66 std::unordered_map<std::string, std::string> properties);
67
69 std::unordered_map<std::string, std::string> ExtractHeaders() const;
70
73 Result<std::string_view> Uri() const;
74
79 Result<SnapshotMode> SnapshotLoadingMode() const;
80};
81
82} // namespace iceberg::rest
SnapshotMode
Snapshot loading mode for REST catalog.
Definition catalog_properties.h:35
Definition config.h:70
Definition config.h:67
Configuration class for a REST Catalog.
Definition catalog_properties.h:39