haizhou-zhao commented on code in PR #14334:
URL: https://github.com/apache/iceberg/pull/14334#discussion_r2512913518
##########
core/src/main/java/org/apache/iceberg/UpdateRequirement.java:
##########
@@ -230,4 +231,54 @@ public void validate(TableMetadata base) {
}
}
}
+
+ class AssertCurrentViewVersionID implements UpdateRequirement {
+ private final int viewVersionId;
+
+ public AssertCurrentViewVersionID(int viewVersionId) {
+ this.viewVersionId = viewVersionId;
+ }
+
+ public int viewVersionId() {
+ return viewVersionId;
+ }
+
+ @Override
+ public void validate(ViewMetadata base) {
+ if (viewVersionId != base.currentVersionId()) {
+ throw new CommitFailedException(
+ "Requirement failed: current view version changed: expected
version %s != %s",
+ viewVersionId, base.currentVersionId());
+ }
+ }
+ }
+
+ /**
+ * Assuming that view ID is incrementing integers, so the last assigned view
version ID is always
+ * the max ID that has been assigned.
+ */
+ class AssertLastAssignedViewVersionID implements UpdateRequirement {
Review Comment:
ack. Discussed offline
--
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]