rdblue commented on code in PR #7770:
URL: https://github.com/apache/iceberg/pull/7770#discussion_r1676478216


##########
core/src/main/java/org/apache/iceberg/BaseSnapshot.java:
##########
@@ -62,14 +70,56 @@ class BaseSnapshot implements Snapshot {
       Map<String, String> summary,
       Integer schemaId,
       String manifestList) {
+    this(
+        sequenceNumber,
+        snapshotId,
+        parentId,
+        timestampMillis,
+        operation,
+        summary,
+        schemaId,
+        manifestList,
+        0L,
+        null,
+        null,
+        null);
+  }
+
+  BaseSnapshot(
+      long sequenceNumber,
+      long snapshotId,
+      Long parentId,
+      long timestampMillis,
+      String operation,
+      Map<String, String> summary,
+      Integer schemaId,
+      String manifestListLocation,
+      long manifestListSize,
+      ByteBuffer manifestListKeyMetadata,
+      ByteBuffer wrappedManifestListKeyMetadata,
+      String wrappedKeyEncryptionKey) {
     this.sequenceNumber = sequenceNumber;
     this.snapshotId = snapshotId;
     this.parentId = parentId;
     this.timestampMillis = timestampMillis;
     this.operation = operation;
     this.summary = summary;
     this.schemaId = schemaId;
-    this.manifestListLocation = manifestList;
+    this.manifestListLocation = manifestListLocation;
+    this.manifestListSize = manifestListSize;
+    this.manifestListKeyMetadata = manifestListKeyMetadata;
+    if (wrappedManifestListKeyMetadata != null) {
+      Preconditions.checkArgument(
+          wrappedManifestListKeyMetadata.arrayOffset() == 0, "Offset must be 
0");

Review Comment:
   I appreciate that this is checking the offset rather than ignoring it, but 
it is always better to use utils in `ByteBuffers` instead. What about using 
`ByteBuffers.toByteArray` for this?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to