44 static Result<std::vector<std::shared_ptr<Snapshot>>> AncestorsOf(
const Table& table,
52 static Result<std::vector<std::shared_ptr<Snapshot>>> AncestorsOf(
60 static Result<std::vector<std::shared_ptr<Snapshot>>> AncestorsOf(
62 const std::function<Result<std::shared_ptr<Snapshot>>(int64_t)>& lookup);
70 static Result<bool> IsAncestorOf(
const Table& table, int64_t ancestor_snapshot_id);
78 static Result<bool> IsAncestorOf(
const TableMetadata& metadata,
79 int64_t ancestor_snapshot_id);
87 static Result<bool> IsAncestorOf(
const Table& table, int64_t snapshot_id,
88 int64_t ancestor_snapshot_id);
96 static Result<bool> IsAncestorOf(
const TableMetadata& metadata, int64_t snapshot_id,
97 int64_t ancestor_snapshot_id);
106 static Result<bool> IsAncestorOf(
107 int64_t snapshot_id, int64_t ancestor_snapshot_id,
108 const std::function<Result<std::shared_ptr<Snapshot>>(int64_t)>& lookup);
117 static Result<bool> IsParentAncestorOf(
const Table& table, int64_t snapshot_id,
118 int64_t ancestor_parent_snapshot_id);
127 static Result<bool> IsParentAncestorOf(
const TableMetadata& metadata,
129 int64_t ancestor_parent_snapshot_id);
138 static Result<bool> IsParentAncestorOf(
139 int64_t snapshot_id, int64_t ancestor_parent_snapshot_id,
140 const std::function<Result<std::shared_ptr<Snapshot>>(int64_t)>& lookup);
147 static Result<std::vector<std::shared_ptr<Snapshot>>> CurrentAncestors(
155 static Result<std::vector<std::shared_ptr<Snapshot>>> CurrentAncestors(
166 static Result<std::vector<int64_t>> CurrentAncestorIds(
const Table& table);
173 static Result<std::optional<std::shared_ptr<Snapshot>>> OldestAncestor(
186 static Result<std::optional<std::shared_ptr<Snapshot>>> OldestAncestorOf(
187 const Table& table, int64_t snapshot_id);
199 static Result<std::optional<std::shared_ptr<Snapshot>>> OldestAncestorOf(
210 static Result<std::optional<std::shared_ptr<Snapshot>>> OldestAncestorAfter(
211 const Table& table, TimePointMs timestamp_ms);
221 static Result<std::vector<int64_t>> SnapshotIdsBetween(
const Table& table,
222 int64_t from_snapshot_id,
223 int64_t to_snapshot_id);
232 static Result<std::vector<int64_t>> AncestorIdsBetween(
233 const Table& table, int64_t latest_snapshot_id,
234 const std::optional<int64_t>& oldest_snapshot_id);
243 static Result<std::vector<std::shared_ptr<Snapshot>>> AncestorsBetween(
244 const Table& table, int64_t latest_snapshot_id,
245 std::optional<int64_t> oldest_snapshot_id);
254 static Result<std::vector<std::shared_ptr<Snapshot>>> AncestorsBetween(
256 std::optional<int64_t> oldest_snapshot_id);
264 static Result<std::shared_ptr<Snapshot>> SnapshotAfter(
const Table& table,
265 int64_t snapshot_id);
272 static Result<int64_t> SnapshotIdAsOfTime(
const Table& table, TimePointMs timestamp_ms);
279 static Result<int64_t> SnapshotIdAsOfTime(
const TableMetadata& metadata,
280 TimePointMs timestamp_ms);
288 static std::optional<int64_t> OptionalSnapshotIdAsOfTime(
const Table& table,
289 TimePointMs timestamp_ms);
296 static Result<std::shared_ptr<Schema>> SchemaFor(
const Table& table,
297 int64_t snapshot_id);
304 static Result<std::shared_ptr<Schema>> SchemaFor(
const Table& table,
305 TimePointMs timestamp_ms);
316 static Result<std::shared_ptr<Schema>> SchemaFor(
const Table& table,
317 const std::string& ref);
328 static Result<std::shared_ptr<Schema>> SchemaFor(
const TableMetadata& metadata,
329 const std::string& ref);
340 static Result<std::shared_ptr<Snapshot>> LatestSnapshot(
const Table& table,
341 const std::string& branch);
356 static Result<std::shared_ptr<Snapshot>> LatestSnapshot(
const TableMetadata& metadata,
357 const std::string& branch);
368 static Result<std::shared_ptr<Snapshot>> OptionalLatestSnapshot(
372 static int64_t GenerateSnapshotId();
378 static int64_t GenerateSnapshotId(
const TableMetadata& metadata);
386 static Result<std::vector<std::shared_ptr<Snapshot>>> AncestorsOf(
387 const TableMetadata& metadata,
const std::shared_ptr<Snapshot>& snapshot);
394 static Result<std::vector<std::shared_ptr<Snapshot>>> AncestorsOf(
395 const std::shared_ptr<Snapshot>& snapshot,
396 const std::function<Result<std::shared_ptr<Snapshot>>(int64_t)>& lookup);
402 static Result<std::vector<int64_t>> ToIds(
403 const std::vector<std::shared_ptr<Snapshot>>& snapshots);