iceberg-cpp
Loading...
Searching...
No Matches
hive_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/hive/iceberg_hive_export.h"
26#include "iceberg/result.h"
27#include "iceberg/util/config.h"
28
31
32namespace iceberg::hive {
33
39enum class HiveThriftTransport : uint8_t { kBuffered, kFramed };
40
46class ICEBERG_HIVE_EXPORT HiveCatalogProperties
47 : public ConfigBase<HiveCatalogProperties> {
48 public:
49 template <typename T>
50 using Entry = const ConfigBase<HiveCatalogProperties>::Entry<T>;
51
59 inline static Entry<std::string> kUri{"uri", ""};
60
62 inline static Entry<std::string> kName{"name", "hive"};
63
67 inline static Entry<std::string> kWarehouse{"warehouse", ""};
68
71 inline static Entry<std::string> kIOImpl{"io-impl", ""};
72
74 inline static Entry<std::string> kThriftTransport{"thrift-transport", "buffered"};
75
77 inline static Entry<int> kConnectTimeoutMs{"connect-timeout-ms", 30000};
78
80 inline static Entry<int> kSocketTimeoutMs{"socket-timeout-ms", 60000};
81
86 inline static Entry<bool> kLockEnabled{"hive.lock-enabled", false};
87
89 static HiveCatalogProperties default_properties();
90
92 static HiveCatalogProperties FromMap(
93 std::unordered_map<std::string, std::string> properties);
94
96 Result<std::string_view> Uri() const;
97
101 Result<HiveThriftTransport> ThriftTransport() const;
102};
103
104} // namespace iceberg::hive
Definition config.h:70
Definition config.h:67
Configuration for the iceberg_hive HiveCatalog.
Definition hive_catalog_properties.h:47
HiveThriftTransport
Thrift framing mode used to connect to the Hive Metastore.
Definition hive_catalog_properties.h:39