You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/11/14 18:51:32 UTC

[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #631: Add mechanism to expire old metadata versions

aokolnychyi commented on a change in pull request #631: Add mechanism to expire old metadata versions
URL: https://github.com/apache/incubator-iceberg/pull/631#discussion_r346426537
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
 ##########
 @@ -182,7 +230,17 @@ public String toString() {
       }
       last = logEntry;
     }
-
+    this.previousMetadata = previousMetadata;
+    MetadataLogEntry previous = null;
+    for (MetadataLogEntry metadataEntry : previousMetadata) {
+      if (previous != null) {
+        Preconditions.checkArgument(
+                (metadataEntry.timestampMillis() - previous.timestampMillis()) >= 0,
+                "[BUG] Expected sorted previous metadata log entries.");
+      }
+      previous = metadataEntry;
+    }
+    this.removedPreviousMetadata = removedPreviousMetadata;
 
 Review comment:
   I like the current structure of the constructor in `TableMetadata`: it starts with a block of assignments, followed by a block of indexing, and ends with a block of validation. Can we keep that structure? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org