59 std::shared_ptr<Transaction> transaction);
169 int32_t min_snapshots_to_keep);
177 int64_t max_snapshot_age_ms);
190 SnapshotManager(std::shared_ptr<Transaction> transaction,
bool is_external_transaction);
196 Status CommitIfRefUpdatesExist();
198 std::shared_ptr<Transaction> transaction_;
199 const bool is_external_transaction_;
200 std::shared_ptr<UpdateSnapshotReference> update_snap_refs_;
Base class for collecting errors in the builder pattern.
Definition error_collector.h:93
API for managing snapshots.
Definition snapshot_manager.h:50
SnapshotManager & ReplaceBranch(const std::string &from, const std::string &to)
Replace the 'from' branch to point to the 'to' snapshot. The 'to' will remain unchanged,...
SnapshotManager & RollbackToTime(int64_t timestamp_ms)
Roll this table's data back to the last snapshot before the given timestamp.
SnapshotManager & SetMaxSnapshotAgeMs(const std::string &branch_name, int64_t max_snapshot_age_ms)
Update the max snapshot age for a branch.
SnapshotManager & RemoveTag(const std::string &name)
Remove the tag with the given name.
static Result< std::shared_ptr< SnapshotManager > > Make(std::shared_ptr< Transaction > transaction)
Create a SnapshotManager from an existing transaction.
SnapshotManager & ReplaceTag(const std::string &name, int64_t snapshot_id)
Replace the tag with the given name to point to the specified snapshot.
SnapshotManager & CreateBranch(const std::string &name, int64_t snapshot_id)
Create a new branch pointing to the given snapshot id.
Status Commit()
Commit all pending changes.
SnapshotManager & SetCurrentSnapshot(int64_t snapshot_id)
Roll this table's data back to a specific snapshot identified by id.
SnapshotManager & SetMaxRefAgeMs(const std::string &name, int64_t max_ref_age_ms)
Update the retention policy for a reference.
SnapshotManager & CreateBranch(const std::string &name)
Create a new branch. The branch will point to current snapshot if the current snapshot is not NULL....
SnapshotManager & RenameBranch(const std::string &name, const std::string &new_name)
Rename a branch.
static Result< std::shared_ptr< SnapshotManager > > Make(std::shared_ptr< Table > table)
Create a SnapshotManager that owns its own transaction.
SnapshotManager & Cherrypick(int64_t snapshot_id)
Apply supported changes in given snapshot and create a new snapshot which will be set as the current ...
SnapshotManager & ReplaceBranch(const std::string &name, int64_t snapshot_id)
Replace the branch with the given name to point to the specified snapshot.
SnapshotManager & RollbackTo(int64_t snapshot_id)
Rollback table's state to a specific snapshot identified by id.
SnapshotManager & RemoveBranch(const std::string &name)
Remove a branch by name.
SnapshotManager & CreateTag(const std::string &name, int64_t snapshot_id)
Create a new tag pointing to the given snapshot id.
SnapshotManager & FastForwardBranch(const std::string &from, const std::string &to)
Perform a fast-forward of 'from' up to the 'to' snapshot if 'from' is an ancestor of 'to'....
SnapshotManager & SetMinSnapshotsToKeep(const std::string &branch_name, int32_t min_snapshots_to_keep)
Update the minimum number of snapshots to keep for a branch.
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.