24#include <unordered_map>
42 std::shared_ptr<TransactionContext> ctx);
78 const std::string& new_name);
117 int32_t min_snapshots_to_keep);
125 int64_t max_snapshot_age_ms);
133 int64_t max_ref_age_ms);
135 Kind
kind() const final {
return Kind::kUpdateSnapshotReference; }
146 std::vector<std::pair<std::string, std::shared_ptr<SnapshotRef>>>
to_set;
158 const std::string& to,
161 std::unordered_map<std::string, std::shared_ptr<SnapshotRef>> updated_refs_;
Base class for all kinds of table metadata updates.
Definition pending_update.h:41
Updates snapshot references.
Definition update_snapshot_reference.h:39
Kind kind() const final
Return the kind of this pending update.
Definition update_snapshot_reference.h:135
UpdateSnapshotReference & SetMaxRefAgeMs(const std::string &name, int64_t max_ref_age_ms)
Set the maximum reference age in milliseconds.
UpdateSnapshotReference & FastForward(const std::string &from, const std::string &to)
Fast-forward a branch to another reference's snapshot ID.
UpdateSnapshotReference & ReplaceBranch(const std::string &name, int64_t snapshot_id)
Replace a branch reference with a new snapshot ID.
UpdateSnapshotReference & SetMaxSnapshotAgeMs(const std::string &name, int64_t max_snapshot_age_ms)
Set the maximum snapshot age in milliseconds for a branch.
bool IsRetryable() const override
Snapshot reference updates are not retryable.
Definition update_snapshot_reference.h:142
UpdateSnapshotReference & RemoveTag(const std::string &name)
Remove a tag reference.
UpdateSnapshotReference & CreateBranch(const std::string &name, int64_t snapshot_id)
Create a branch reference.
UpdateSnapshotReference & RemoveBranch(const std::string &name)
Remove a branch reference.
UpdateSnapshotReference & ReplaceBranch(const std::string &from, const std::string &to)
Replace a branch reference with another reference's snapshot ID.
UpdateSnapshotReference & ReplaceTag(const std::string &name, int64_t snapshot_id)
Replace a tag reference with a new snapshot ID.
UpdateSnapshotReference & RenameBranch(const std::string &name, const std::string &new_name)
Rename a branch reference.
UpdateSnapshotReference & SetMinSnapshotsToKeep(const std::string &name, int32_t min_snapshots_to_keep)
Set the minimum number of snapshots to keep for a branch.
Result< ApplyResult > Apply()
Apply the pending changes and return the updated and removed references.
UpdateSnapshotReference & CreateTag(const std::string &name, int64_t snapshot_id)
Create a tag reference.
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
Definition update_snapshot_reference.h:144
std::vector< std::string > to_remove
Reference names to remove.
Definition update_snapshot_reference.h:148
std::vector< std::pair< std::string, std::shared_ptr< SnapshotRef > > > to_set
References to set or update (name, ref pairs)
Definition update_snapshot_reference.h:146