iceberg-cpp
Loading...
Searching...
No Matches
hms_client.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 <memory>
23#include <string>
24#include <string_view>
25#include <vector>
26
29#include "iceberg/result.h"
30
35
36namespace iceberg::hive {
37
39inline constexpr int kDefaultHmsPort = 9083;
40
50struct ICEBERG_HIVE_EXPORT HmsEndpoint {
51 std::string host;
52 int port = kDefaultHmsPort;
53};
54
61ICEBERG_HIVE_EXPORT Result<std::vector<HmsEndpoint>> ParseHmsUris(std::string_view uri);
62
68class ICEBERG_HIVE_EXPORT HmsClient {
69 public:
70 ~HmsClient();
71
72 HmsClient(const HmsClient&) = delete;
73 HmsClient& operator=(const HmsClient&) = delete;
74 HmsClient(HmsClient&&) = delete;
75 HmsClient& operator=(HmsClient&&) = delete;
76
83
84 private:
85 class Impl;
86 std::unique_ptr<Impl> impl_;
87
88 explicit HmsClient(std::unique_ptr<Impl> impl);
89};
90
91} // namespace iceberg::hive
Configuration for the iceberg_hive HiveCatalog.
Definition hive_catalog_properties.h:47
A live connection to a Hive Metastore over Thrift.
Definition hms_client.h:68
static Result< std::unique_ptr< HmsClient > > Connect(const HiveCatalogProperties &config)
Connect to the Hive Metastore described by config.
Configuration for connecting to a Hive Metastore (HMS) over Thrift.
Define symbol visibility macros for the Hive catalog library.
Hive catalog APIs.
Definition hive_catalog.h:34
ICEBERG_HIVE_EXPORT Result< std::vector< HmsEndpoint > > ParseHmsUris(std::string_view uri)
Parse an HMS URI string into one or more endpoints.
constexpr int kDefaultHmsPort
Hive's well-known metastore port, used when an HMS URI omits one.
Definition hms_client.h:39
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
A single host:port pair parsed from an HMS URI.
Definition hms_client.h:50