rymurr commented on a change in pull request #3257:
URL: https://github.com/apache/iceberg/pull/3257#discussion_r757635523
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -713,6 +713,64 @@ public TableMetadata removeSnapshotLogEntries(Set<Long>
snapshotIds) {
snapshots, newSnapshotLog, addPreviousFile(metadataFileLocation,
lastUpdatedMillis));
}
+ /**
+ * Returns an updated {@link TableMetadata} with the current-snapshot-ID set
to the given
+ * snapshot-ID and the snapshot-log reset to contain only the snapshot with
the given snapshot-ID.
+ *
+ * @param snapshotId ID of a snapshot that must exist, or {@code -1L} to
remove the current snapshot
+ * and return an empty snapshot log.
+ * @return {@link TableMetadata} with updated {@link #currentSnapshotId} and
{@link #snapshotLog}
+ */
+ public TableMetadata withCurrentSnapshotOnly(long snapshotId) {
Review comment:
looking forward to getting #3580 in :-)
##########
File path:
core/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java
##########
@@ -184,13 +184,17 @@ protected void refreshFromMetadataLocation(String
newLocation, Predicate<Excepti
"Table UUID does not match: current=%s != refreshed=%s",
currentMetadata.uuid(), newUUID);
}
- this.currentMetadata = newMetadata.get();
+ this.currentMetadata = maybeValidateAndUpdateMetadata(newMetadata.get());
Review comment:
I don't like this as a pattern. It feels like bad OOP. Can this be
refactored? Or can `NessieCatalog` re-implement `refreshFromMetadataLocation`?
##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java
##########
@@ -338,21 +340,32 @@ String currentRefName() {
return reference.getName();
}
+ FileIO fileIO() {
Review comment:
in which class? Can't find 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]