Skip to content

Commit ebb771a

Browse files
committed
fix: review comments
1 parent 7d30c11 commit ebb771a

File tree

4 files changed

+10
-168
lines changed

4 files changed

+10
-168
lines changed

src/iceberg/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ if(ICEBERG_BUILD_BUNDLE)
178178
SOURCES
179179
expire_snapshots_test.cc
180180
fast_append_test.cc
181-
set_snapshot_test.cc
182181
snapshot_manager_test.cc
183182
transaction_test.cc
184183
update_location_test.cc

src/iceberg/test/set_snapshot_test.cc

Lines changed: 0 additions & 155 deletions
This file was deleted.

src/iceberg/transaction.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,8 @@ Transaction::NewUpdateSnapshotReference() {
426426
}
427427

428428
Result<std::shared_ptr<SnapshotManager>> Transaction::NewSnapshotManager() {
429-
ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr<SnapshotManager> snapshot_manager,
430-
SnapshotManager::Make(shared_from_this()));
431429
// SnapshotManager has its own commit logic, so it is not added to the pending updates.
432-
// This differs from the Java implementation.
433-
return snapshot_manager;
430+
return SnapshotManager::Make(shared_from_this());
434431
}
435432

436433
} // namespace iceberg

src/iceberg/transaction.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,9 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this<Transacti
9494
/// changes.
9595
Result<std::shared_ptr<UpdateLocation>> NewUpdateLocation();
9696

97-
/// \brief Create a new SetSnapshot to set the current snapshot or rollback to a
98-
/// previous snapshot and commit the changes.
99-
Result<std::shared_ptr<SetSnapshot>> NewSetSnapshot();
100-
10197
/// \brief Create a new FastAppend to append data files and commit the changes.
10298
Result<std::shared_ptr<FastAppend>> NewFastAppend();
10399

104-
/// \brief Create a new UpdateSnapshotReference to update snapshot references (branches
105-
/// and tags) and commit the changes.
106-
Result<std::shared_ptr<UpdateSnapshotReference>> NewUpdateSnapshotReference();
107-
108100
/// \brief Create a new SnapshotManager to manage snapshots.
109101
Result<std::shared_ptr<SnapshotManager>> NewSnapshotManager();
110102

@@ -114,6 +106,14 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this<Transacti
114106

115107
Status AddUpdate(const std::shared_ptr<PendingUpdate>& update);
116108

109+
/// \brief Create a new SetSnapshot to set the current snapshot or rollback to a
110+
/// previous snapshot and commit the changes.
111+
Result<std::shared_ptr<SetSnapshot>> NewSetSnapshot();
112+
113+
/// \brief Create a new UpdateSnapshotReference to update snapshot references (branches
114+
/// and tags) and commit the changes.
115+
Result<std::shared_ptr<UpdateSnapshotReference>> NewUpdateSnapshotReference();
116+
117117
/// \brief Apply the pending changes to current table.
118118
Status Apply(PendingUpdate& updates);
119119

@@ -132,6 +132,7 @@ class ICEBERG_EXPORT Transaction : public std::enable_shared_from_this<Transacti
132132

133133
private:
134134
friend class PendingUpdate;
135+
friend class SnapshotManager;
135136

136137
// The table that this transaction will update.
137138
std::shared_ptr<Table> table_;

0 commit comments

Comments
 (0)