rdblue commented on code in PR #19030:
URL: https://github.com/apache/iceberg/pull/19030#discussion_r4645235190
##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -286,25 +289,42 @@ public ThisT deleteWith(Consumer<String> deleteCallback) {
protected void validate(TableMetadata currentMetadata, Snapshot snapshot) {}
/**
- * Apply the update's changes to the given metadata and snapshot. Return the
new manifest list.
+ * Apply the update's changes to the given metadata and snapshot. Return the
new version's
+ * manifests as a list.
*
* @param metadataToUpdate the base table metadata to apply changes to
- * @param snapshot snapshot to apply the changes to
+ * @param snapshot snapshot to apply the changes to; will be the new
snapshot's parent
* @return a manifest list for the new snapshot.
*/
protected abstract List<ManifestFile> apply(TableMetadata metadataToUpdate,
Snapshot snapshot);
- @Override
- public Snapshot apply() {
- refresh();
- Snapshot parentSnapshot = SnapshotUtil.latestSnapshot(base, targetBranch);
-
- long sequenceNumber = base.nextSequenceNumber();
- Long parentSnapshotId = parentSnapshot == null ? null :
parentSnapshot.snapshotId();
+ /** Result type for root file writes implemented by child operations. */
+ protected record NewSnapshotMetadata(
+ String manifestListLocation,
+ String rootManifestLocation,
+ long rootFileSize,
+ Long assignedRowIds,
+ Set<String> manifestLocations) {
+ private String rootLocation() {
+ return manifestListLocation != null ? manifestListLocation :
rootManifestLocation;
+ }
+ }
- runValidations(parentSnapshot);
+ /**
+ * Apply the update's change to the given metadata and snapshot. Return the
new root manifest
+ * metadata.
+ *
+ * @param metadataToUpdate the base table metadata to apply changes to
+ * @param parent snapshot to apply the changes to; will be the new
snapshot's parent
+ * @return a {@link TrackedFile} for the new root manifest
+ */
Review Comment:
You're right. This is out of date now. I'll update it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]