A reference to a snapshot, either a branch or a tag.
More...
#include <snapshot.h>
|
|
SnapshotRefType | type () const noexcept |
| |
|
std::optional< int64_t > | max_ref_age_ms () const noexcept |
| |
| std::unique_ptr< SnapshotRef > | Clone (std::optional< int64_t > new_snapshot_id=std::nullopt) const |
| | Clone this SnapshotRef with an optional new snapshot ID.
|
| |
|
Status | Validate () const |
| | Validate the SnapshotRef.
|
| |
|
| static Result< std::unique_ptr< SnapshotRef > > | MakeBranch (int64_t snapshot_id, std::optional< int32_t > min_snapshots_to_keep=std::nullopt, std::optional< int64_t > max_snapshot_age_ms=std::nullopt, std::optional< int64_t > max_ref_age_ms=std::nullopt) |
| | Create a branch reference.
|
| |
| static Result< std::unique_ptr< SnapshotRef > > | MakeTag (int64_t snapshot_id, std::optional< int64_t > max_ref_age_ms=std::nullopt) |
| | Create a tag reference.
|
| |
|
|
int64_t | snapshot_id |
| | A reference's snapshot ID. The tagged snapshot or latest snapshot of a branch.
|
| |
|
std::variant< Branch, Tag > | retention |
| | Snapshot retention policy.
|
| |
|
|
static constexpr std::string_view | kMainBranch = "main" |
| |
A reference to a snapshot, either a branch or a tag.
◆ Clone()
| std::unique_ptr< SnapshotRef > iceberg::SnapshotRef::Clone |
( |
std::optional< int64_t > |
new_snapshot_id = std::nullopt | ) |
const |
Clone this SnapshotRef with an optional new snapshot ID.
- Parameters
-
| new_snapshot_id | Optional new snapshot ID. If not provided, uses the current snapshot_id |
- Returns
- A unique_ptr to the cloned SnapshotRef
◆ MakeBranch()
| Result< std::unique_ptr< SnapshotRef > > iceberg::SnapshotRef::MakeBranch |
( |
int64_t |
snapshot_id, |
|
|
std::optional< int32_t > |
min_snapshots_to_keep = std::nullopt, |
|
|
std::optional< int64_t > |
max_snapshot_age_ms = std::nullopt, |
|
|
std::optional< int64_t > |
max_ref_age_ms = std::nullopt |
|
) |
| |
|
static |
Create a branch reference.
- Parameters
-
| snapshot_id | The snapshot ID for the branch |
| min_snapshots_to_keep | Optional minimum number of snapshots to keep |
| max_snapshot_age_ms | Optional maximum snapshot age in milliseconds |
| max_ref_age_ms | Optional maximum reference age in milliseconds |
- Returns
- A Result containing a unique_ptr to the SnapshotRef, or an error if validation failed
◆ MakeTag()
| Result< std::unique_ptr< SnapshotRef > > iceberg::SnapshotRef::MakeTag |
( |
int64_t |
snapshot_id, |
|
|
std::optional< int64_t > |
max_ref_age_ms = std::nullopt |
|
) |
| |
|
static |
Create a tag reference.
- Parameters
-
| snapshot_id | The snapshot ID for the tag |
| max_ref_age_ms | Optional maximum reference age in milliseconds |
- Returns
- A Result containing a unique_ptr to the SnapshotRef, or an error if validation failed
The documentation for this struct was generated from the following files: