wgtmac commented on code in PR #44990:
URL: https://github.com/apache/arrow/pull/44990#discussion_r1953027415


##########
cpp/src/parquet/file_reader.cc:
##########
@@ -314,11 +314,7 @@ class SerializedFile : public ParquetFileReader::Contents {
     }
   }
 
-  void Close() override {
-    if (file_metadata_ && file_metadata_->file_decryptor()) {
-      file_metadata_->file_decryptor()->WipeOutDecryptionKeys();
-    }
-  }

Review Comment:
   Same question here.



##########
cpp/src/parquet/column_reader.cc:
##########
@@ -306,8 +306,13 @@ class SerializedPageReader : public PageReader {
   // Please refer to the encryption specification for more details:
   // 
https://github.com/apache/parquet-format/blob/encryption/Encryption.md#44-additional-authenticated-data
 
-  // The ordinal fields in the context below are used for AAD suffix 
calculation.
+  // The CryptoContext used by this PageReader.
   CryptoContext crypto_ctx_;
+  // This PageReader has its own Decryptor instances in order to be 
thread-safe.

Review Comment:
   Why not directly caching `meta_decryptor_` and `data_decryptor_` in the 
above `CryptoContext`?



##########
cpp/src/parquet/column_reader.h:
##########
@@ -114,8 +115,8 @@ struct CryptoContext {
   bool start_decrypt_with_dictionary_page = false;
   int16_t row_group_ordinal = -1;
   int16_t column_ordinal = -1;
-  std::shared_ptr<Decryptor> meta_decryptor;
-  std::shared_ptr<Decryptor> data_decryptor;
+  std::function<std::shared_ptr<Decryptor>()> meta_decryptor;

Review Comment:
   nit: rename to `meta_decryptor_creator` or something alike for better 
readability. 



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

Reply via email to