iceberg-cpp
Loading...
Searching...
No Matches
iceberg
update
pending_update.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
24
25
#include <memory>
26
27
#include "iceberg/iceberg_export.h"
28
#include "iceberg/result.h"
29
#include "
iceberg/type_fwd.h
"
30
#include "
iceberg/util/error_collector.h
"
31
32
namespace
iceberg {
33
41
class
ICEBERG_EXPORT
PendingUpdate
:
public
ErrorCollector
{
42
public
:
43
enum class
Kind : uint8_t {
44
kExpireSnapshots,
45
kSetSnapshot,
46
kUpdateLocation,
47
kUpdatePartitionSpec,
48
kUpdatePartitionStatistics,
49
kUpdateProperties,
50
kUpdateSchema,
51
kUpdateSnapshot,
52
kUpdateSnapshotReference,
53
kUpdateSortOrder,
54
kUpdateStatistics,
55
};
56
58
virtual
Kind
kind
()
const
= 0;
59
61
virtual
bool
IsRetryable
()
const
= 0;
62
69
virtual
Status Commit();
70
79
virtual
Status Finalize(Result<const TableMetadata*> commit_result);
80
81
// Non-copyable, movable
82
PendingUpdate
(
const
PendingUpdate
&) =
delete
;
83
PendingUpdate
& operator=(
const
PendingUpdate
&) =
delete
;
84
PendingUpdate
(
PendingUpdate
&&) noexcept = default;
85
PendingUpdate
& operator=(
PendingUpdate
&&) noexcept = default;
86
87
~
PendingUpdate
() override;
88
89
protected:
90
explicit
PendingUpdate
(
std
::shared_ptr<
TransactionContext
> ctx);
91
92
const
TableMetadata
& base() const;
93
94
std
::shared_ptr<
TransactionContext
> ctx_;
95
};
96
97
}
// namespace iceberg
iceberg::ErrorCollector
Base class for collecting errors in the builder pattern.
Definition
error_collector.h:93
iceberg::PendingUpdate
Base class for all kinds of table metadata updates.
Definition
pending_update.h:41
iceberg::PendingUpdate::kind
virtual Kind kind() const =0
Return the kind of this pending update.
iceberg::PendingUpdate::IsRetryable
virtual bool IsRetryable() const =0
Whether this update can be retried after a commit conflict.
iceberg::TransactionContext
Shared context between Transaction and PendingUpdate instances.
Definition
transaction.h:161
error_collector.h
std
STL namespace.
iceberg::TableMetadata
Represents the metadata for an Iceberg table.
Definition
table_metadata.h:72
type_fwd.h
Generated by
1.9.8