|
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. | |
| virtual Status | Finalize (Result< const TableMetadata * > commit_result) |
| Finalize the pending update. | |
| PendingUpdate (const PendingUpdate &)=delete | |
| PendingUpdate & | operator= (const PendingUpdate &)=delete |
| PendingUpdate (PendingUpdate &&) noexcept=default | |
| PendingUpdate & | operator= (PendingUpdate &&) noexcept=default |
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 and return reference to derived class. | |
| auto & | AddError (this auto &self, Error err) |
| Add an existing error object and return reference to derived class. | |
| auto & | AddError (this auto &self, std::unexpected< Error > err) |
| Add an unexpected result's error and return reference to derived class. | |
| 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 |
Protected Attributes | |
| std::shared_ptr< TransactionContext > | ctx_ |
Protected Attributes inherited from iceberg::ErrorCollector | |
| std::vector< Error > | errors_ |
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.
|
virtual |
Apply the pending changes and commit.
|
virtual |
Finalize the pending update.
This method is called after the update is committed. Implementations should override this method to clean up any resources.
| commit_result | The committed table metadata when the commit succeeds, or the commit error when it fails. |
Reimplemented in iceberg::ExpireSnapshots, and 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.