iceberg-cpp
Loading...
Searching...
No Matches
update_location.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_view>
24
25#include "iceberg/type_fwd.h"
27
30
31namespace iceberg {
32
34class ICEBERG_EXPORT UpdateLocation : public PendingUpdate {
35 public:
36 static Result<std::shared_ptr<UpdateLocation>> Make(
37 std::shared_ptr<TransactionContext> ctx);
38
39 ~UpdateLocation() override;
40
45 UpdateLocation& SetLocation(std::string_view location);
46
47 Kind kind() const final { return Kind::kUpdateLocation; }
48 bool IsRetryable() const override { return true; }
49
51 Result<std::string> Apply();
52
53 private:
54 explicit UpdateLocation(std::shared_ptr<TransactionContext> ctx);
55
56 std::string location_;
57};
58
59} // namespace iceberg
Base class for all kinds of table metadata updates.
Definition pending_update.h:41
Updating table location with a new base location.
Definition update_location.h:34
bool IsRetryable() const override
Whether this update can be retried after a commit conflict.
Definition update_location.h:48
Kind kind() const final
Return the kind of this pending update.
Definition update_location.h:47