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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to