|
iceberg-cpp
|
Base class for all kinds of table metadata updates. More...
#include <pending_update.h>
Public Member Functions | |
| virtual Kind | kind () const =0 |
| Return the kind of this pending update. | |
| virtual bool | IsRetryable () const =0 |
| Whether this update can be retried after a commit conflict. | |
| virtual Status | Commit () |
| Apply the pending changes and commit. | |
| PendingUpdate (const PendingUpdate &)=delete | |
| PendingUpdate & | operator= (const PendingUpdate &)=delete |
| PendingUpdate (PendingUpdate &&)=delete | |
| PendingUpdate & | operator= (PendingUpdate &&)=delete |
Public Member Functions inherited from iceberg::ErrorCollector | |
| ErrorCollector (ErrorCollector &&)=default | |
| ErrorCollector & | operator= (ErrorCollector &&)=default |
| ErrorCollector (const ErrorCollector &)=default | |
| ErrorCollector & | operator= (const ErrorCollector &)=default |
| template<typename... Args> | |
| auto & | AddError (this auto &self, ErrorKind kind, const std::format_string< Args... > fmt, Args &&... args) |
| Add a specific error. | |
| auto & | AddError (this auto &self, Error err) |
| Add an existing error object. | |
| auto & | AddError (this auto &self, ::iceberg::unexpected< Error > err) |
| Add an unexpected result's error. | |
| auto & | AddError (this auto &self, std::unexpected< Error > err) |
| bool | has_errors () const |
| Check if any errors have been collected. | |
| size_t | error_count () const |
| Get the number of errors collected. | |
| Status | CheckErrors () const |
| Check for accumulated errors and return them if any exist. | |
| void | ClearErrors () |
| Clear all accumulated errors. | |
| const std::vector< Error > & | errors () const |
| Get read-only access to all collected errors. | |
Protected Member Functions | |
| PendingUpdate (std::shared_ptr< TransactionContext > ctx) | |
| const TableMetadata & | base () const |
| Status | CheckCommitAllowed () const |
| virtual Status | CleanStaged () |
| Discard this generation's staging, retaining applied operation intent. | |
| virtual Status | Finalize (const TableMetadata &committed) |
| Complete a known successful commit. Called only by Transaction with the final committed table metadata. | |
Protected Attributes | |
| std::shared_ptr< TransactionContext > | ctx_ |
Protected Attributes inherited from iceberg::ErrorCollector | |
| std::vector< Error > | errors_ |
Friends | |
| class | Transaction |
Base class for all kinds of table metadata updates.
Any created PendingUpdate instance is tracked by the Transaction instance and commit is also delegated to the Transaction instance.
Lifecycle: an update is configured through its fluent mutators, then committed exactly once. After that point the update is owned by its transaction until the transaction reaches a terminal state.
Commit(). Callers must not mutate input objects or reconfigure an update after its first commit.
|
inlineprotectedvirtual |
Discard this generation's staging, retaining applied operation intent.
Reimplemented in iceberg::SnapshotUpdate.
|
virtual |
Apply the pending changes and commit.
std::shared_ptr before calling Commit(). An Apply failure is terminal and cannot be corrected within the same transaction. Reimplemented in iceberg::SnapshotUpdate.
|
protectedvirtual |
Complete a known successful commit. Called only by Transaction with the final committed table metadata.
Reimplemented in iceberg::SnapshotUpdate.
|
pure virtual |
Whether this update can be retried after a commit conflict.
Implemented in iceberg::ExpireSnapshots, iceberg::SetSnapshot, iceberg::SnapshotUpdate, iceberg::UpdateLocation, iceberg::UpdatePartitionSpec, iceberg::UpdatePartitionStatistics, iceberg::UpdateProperties, iceberg::UpdateSchema, iceberg::UpdateSnapshotReference, iceberg::UpdateSortOrder, and iceberg::UpdateStatistics.
|
pure virtual |
Return the kind of this pending update.
Implemented in iceberg::ExpireSnapshots, iceberg::SetSnapshot, iceberg::UpdateLocation, iceberg::UpdatePartitionSpec, iceberg::UpdatePartitionStatistics, iceberg::UpdateProperties, iceberg::UpdateSchema, iceberg::UpdateSnapshotReference, iceberg::UpdateSortOrder, iceberg::UpdateStatistics, and iceberg::SnapshotUpdate.