xanderbailey commented on code in PR #2677:
URL: https://github.com/apache/iceberg-rust/pull/2677#discussion_r3471445966


##########
crates/iceberg/src/spec/manifest_list/writer.rs:
##########
@@ -136,6 +137,56 @@ impl ManifestListWriter {
         )
     }
 
+    /// Construct a v1 [`ManifestListWriter`] that writes to an 
[`EncryptedOutputFile`].
+    ///
+    /// Clone `encrypted_output.key_metadata()` before calling — the wrapper is
+    /// consumed, and the metadata is needed to call
+    /// `EncryptionManager::encrypt_manifest_list_key_metadata` after 
[`Self::close`].
+    pub async fn v1_from_encrypted(
+        encrypted_output: EncryptedOutputFile,
+        snapshot_id: i64,
+        parent_snapshot_id: Option<i64>,
+    ) -> Result<Self> {
+        let writer = encrypted_output.writer().await?;
+        Ok(Self::v1(writer, snapshot_id, parent_snapshot_id))
+    }
+
+    /// Construct a v2 [`ManifestListWriter`] that writes to an 
[`EncryptedOutputFile`].
+    /// See [`Self::v1_from_encrypted`] for the key-metadata contract.
+    pub async fn v2_from_encrypted(
+        encrypted_output: EncryptedOutputFile,
+        snapshot_id: i64,
+        parent_snapshot_id: Option<i64>,
+        sequence_number: i64,
+    ) -> Result<Self> {
+        let writer = encrypted_output.writer().await?;
+        Ok(Self::v2(
+            writer,
+            snapshot_id,
+            parent_snapshot_id,
+            sequence_number,
+        ))
+    }
+
+    /// Construct a v3 [`ManifestListWriter`] that writes to an 
[`EncryptedOutputFile`].
+    /// See [`Self::v1_from_encrypted`] for the key-metadata contract.
+    pub async fn v3_from_encrypted(

Review Comment:
   I don’t think we need these new constructors, manifest list writer was 
refactored to take a FileWrite so we can just construct with the correct 
encrypting file writer 



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

Reply via email to