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


##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -257,10 +273,48 @@ public Snapshot apply() {
           .run(index -> manifestFiles[index] = 
manifestsWithMetadata.get(manifests.get(index)));
 
       writer.addAll(Arrays.asList(manifestFiles));
+
+      if (manifestListKeyMetadata != null) {
+        writer.close();
+        manifestListSize = writer.length();
+      }
     } catch (IOException e) {
       throw new RuntimeIOException(e, "Failed to write manifest list file");
     }
 
+    ByteBuffer wrappedManifestListKeyMetadata = null;
+    String wrappedKeyEncryptionKey = null;
+    // Wrap manifest list key
+    if (manifestListKeyMetadata != null) {
+      Preconditions.checkState(
+          encryptionManager instanceof StandardEncryptionManager,
+          "Can't get key encryption key for manifest lists - encryption 
manager %s is not instance of StandardEncryptionManager",
+          encryptionManager.getClass());
+      StandardEncryptionManager standardEncryptionManager =
+          (StandardEncryptionManager) encryptionManager;

Review Comment:
   I think that this should only need to call `unwrapKey` if the wrapped key 
encryption key is not tracked by the encryption manager. There should be no 
need to test and cast the encryption manager to `StandardEncryptionManager` 
anywhere.



-- 
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