Perseus commented on code in PR #3283:
URL: https://github.com/apache/iceberg-rust/pull/3283#discussion_r4478946255


##########
crates/iceberg/src/encryption/io.rs:
##########
@@ -74,8 +74,15 @@ impl EncryptedInputFile {
 
     /// Creates a reader that transparently decrypts on each read.
     pub async fn reader(&self) -> Result<Box<dyn FileRead>> {
+        self.reader_with_wrapper(std::convert::identity).await
+    }
+
+    pub(crate) async fn reader_with_wrapper(
+        &self,
+        wrap: impl FnOnce(Box<dyn FileRead>) -> Box<dyn FileRead>,
+    ) -> Result<Box<dyn FileRead>> {
         let encrypted_length = self.encrypted_length()?;
-        let raw_reader = self.inner.reader().await?;
+        let raw_reader = wrap(self.inner.reader().await?);

Review Comment:
   I'm still iterating on this one; this was added to accurately count the 
number of *encrypted* bytes read from storage instead of using the 
post-decryption number. Not sure that this is the best way to do it though, so 
trying a few things



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