@@ -62,112 +62,10 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
6262 bool IsRetryable () const override { return true ; }
6363 Status Commit () override ;
6464
65- // C++23 uses deducing `this` so chaining keeps returning the derived update type.
66- // C++20 exposes the same operations but returns SnapshotUpdate&, because preserving
67- // the derived type would require making the update hierarchy CRTP. Keyed on the
68- // language version rather than __cpp_explicit_this_parameter, which Apple clang does
69- // not define, and compared with "> 202002L" because MSVC's /std:c++latest only
70- // promises a value above 202002L.
71- #if __cplusplus > 202002L || (defined(_MSVC_LANG) && _MSVC_LANG > 202002L)
7265 // / \brief Set the metrics reporter for this snapshot update.
7366 // /
7467 // / \param reporter The metrics reporter to use.
7568 // / \return Reference to this for method chaining.
76- auto & ReportWith (this auto & self, std::shared_ptr<MetricsReporter> reporter) {
77- static_cast <SnapshotUpdate&>(self).reporter_ = std::move (reporter);
78- return self;
79- }
80-
81- // / \brief Set a callback to delete files instead of the table's default.
82- // /
83- // / \param delete_func A function used to delete file locations.
84- // / \return This update for method chaining.
85- // / \note Cannot be called more than once.
86- auto & DeleteWith (this auto & self,
87- std::function<Status(const std::string&)> delete_func) {
88- if (self.delete_func_ ) {
89- return self.AddError (ErrorKind::kInvalidArgument ,
90- " Cannot set delete callback more than once" );
91- }
92- self.delete_func_ = std::move (delete_func);
93- return self;
94- }
95-
96- // / \brief Stage a snapshot in table metadata, but do not make it current.
97- // /
98- // / The snapshot is assigned an ID and added to table metadata. The table's
99- // / current snapshot ID is not updated.
100- // /
101- // / \return This update for method chaining.
102- auto & StageOnly (this auto & self) {
103- self.stage_only_ = true ;
104- return self;
105- }
106-
107- // / \brief Configure an executor for manifest planning work.
108- // /
109- // / \param executor Executor to use while planning manifests.
110- // / \return Reference to this for method chaining.
111- auto & ScanManifestsWith (this auto & self, Executor& executor) {
112- self.plan_executor_ = std::ref (executor);
113- return self;
114- }
115-
116- // / \brief Perform operations on a particular branch.
117- // /
118- // / \param branch The name of a SnapshotRef of type branch.
119- // / \return This update for method chaining.
120- auto & ToBranch (this auto & self, const std::string& branch) {
121- if (branch.empty ()) [[unlikely]] {
122- return self.AddError (ErrorKind::kInvalidArgument , " Branch name cannot be empty" );
123- }
124-
125- if (auto ref_it = self.base ().refs .find (branch); ref_it != self.base ().refs .end ()) {
126- if (ref_it->second ->type () != SnapshotRefType::kBranch ) {
127- return self.AddError (ErrorKind::kInvalidArgument ,
128- " {} is a tag, not a branch. Tags cannot be targets for "
129- " producing snapshots" ,
130- branch);
131- }
132- }
133-
134- self.target_branch_ = branch;
135- return self;
136- }
137-
138- // / \brief Set a summary property in the snapshot produced by this update.
139- // /
140- // / \param property A String property name.
141- // / \param value A String property value.
142- // / \return This update for method chaining.
143- auto & Set (this auto & self, const std::string& property, const std::string& value) {
144- static_cast <SnapshotUpdate&>(self).SetSummaryProperty (property, value);
145- return self;
146- }
147-
148- // / \brief Configure an executor and max writer count for writing new manifests.
149- // /
150- // / If this method is not called, manifest writes remain serial. When configured,
151- // / files may be split into independent rolling-writer groups.
152- // /
153- // / \note Custom FileIO implementations and registered writer factories used for
154- // / manifest writes must support concurrent calls when an executor is configured.
155- auto & WriteManifestsWith (this auto & self, Executor& executor, int32_t parallelism) {
156- if (parallelism <= 0 ) [[unlikely]] {
157- return self.AddError (
158- ErrorKind::kInvalidArgument ,
159- " Manifest write parallelism must be greater than 0, but was: {}" , parallelism);
160- }
161-
162- self.write_manifest_executor_ = std::ref (executor);
163- self.write_manifest_parallelism_ = parallelism;
164- return self;
165- }
166- #else
167- // / \brief Set the metrics reporter for this snapshot update.
168- // /
169- // / \param reporter The metrics reporter to use.
170- // / \return This snapshot update for method chaining.
17169 SnapshotUpdate& ReportWith (std::shared_ptr<MetricsReporter> reporter) {
17270 reporter_ = std::move (reporter);
17371 return *this ;
@@ -176,7 +74,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
17674 // / \brief Set a callback to delete files instead of the table's default.
17775 // /
17876 // / \param delete_func A function used to delete file locations.
179- // / \return This snapshot update for method chaining.
77+ // / \return This update for method chaining.
18078 // / \note Cannot be called more than once.
18179 SnapshotUpdate& DeleteWith (std::function<Status(const std::string&)> delete_func) {
18280 if (delete_func_) {
@@ -189,7 +87,10 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
18987
19088 // / \brief Stage a snapshot in table metadata, but do not make it current.
19189 // /
192- // / \return This snapshot update for method chaining.
90+ // / The snapshot is assigned an ID and added to table metadata. The table's
91+ // / current snapshot ID is not updated.
92+ // /
93+ // / \return This update for method chaining.
19394 SnapshotUpdate& StageOnly () {
19495 stage_only_ = true ;
19596 return *this ;
@@ -198,7 +99,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
19899 // / \brief Configure an executor for manifest planning work.
199100 // /
200101 // / \param executor Executor to use while planning manifests.
201- // / \return This snapshot update for method chaining.
102+ // / \return Reference to this for method chaining.
202103 SnapshotUpdate& ScanManifestsWith (Executor& executor) {
203104 plan_executor_ = std::ref (executor);
204105 return *this ;
@@ -207,7 +108,7 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
207108 // / \brief Perform operations on a particular branch.
208109 // /
209110 // / \param branch The name of a SnapshotRef of type branch.
210- // / \return This snapshot update for method chaining.
111+ // / \return This update for method chaining.
211112 SnapshotUpdate& ToBranch (const std::string& branch) {
212113 if (branch.empty ()) [[unlikely]] {
213114 AddError (ErrorKind::kInvalidArgument , " Branch name cannot be empty" );
@@ -232,17 +133,22 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
232133 // /
233134 // / \param property A String property name.
234135 // / \param value A String property value.
235- // / \return This snapshot update for method chaining.
136+ // / \return This update for method chaining.
236137 SnapshotUpdate& Set (const std::string& property, const std::string& value) {
237138 SetSummaryProperty (property, value);
238139 return *this ;
239140 }
240141
241142 // / \brief Configure an executor and max writer count for writing new manifests.
242143 // /
144+ // / If this method is not called, manifest writes remain serial. When configured,
145+ // / files may be split into independent rolling-writer groups.
146+ // /
243147 // / \param executor Executor to use while writing manifests.
244148 // / \param parallelism Maximum number of concurrent manifest writers.
245- // / \return This snapshot update for method chaining.
149+ // / \return This update for method chaining.
150+ // / \note Custom FileIO implementations and registered writer factories used for
151+ // / manifest writes must support concurrent calls when an executor is configured.
246152 SnapshotUpdate& WriteManifestsWith (Executor& executor, int32_t parallelism) {
247153 if (parallelism <= 0 ) [[unlikely]] {
248154 AddError (ErrorKind::kInvalidArgument ,
@@ -255,7 +161,6 @@ class ICEBERG_EXPORT SnapshotUpdate : public PendingUpdate {
255161 write_manifest_parallelism_ = parallelism;
256162 return *this ;
257163 }
258- #endif // C++23
259164
260165 protected:
261166 friend class Transaction ;
0 commit comments