mapleFU commented on code in PR #40329:
URL: https://github.com/apache/arrow/pull/40329#discussion_r1534125782


##########
cpp/src/parquet/encryption/key_management_test.cc:
##########
@@ -193,6 +193,26 @@ class TestEncryptionKeyManagement : public ::testing::Test 
{
     TestOnlyInServerWrapKms::FinishKeyRotation();
     crypto_factory_.RemoveCacheEntriesForAllTokens();
   }
+
+  // Create encryption properties without keeping the creating CryptoFactory 
alive
+  std::shared_ptr<FileEncryptionProperties> 
GetOrphanedFileEncryptionProperties(
+      std::shared_ptr<KmsClientFactory> kms_client_factory,
+      EncryptionConfiguration encryption_config) {
+    std::shared_ptr<CryptoFactory> crypto_factory = 
std::make_shared<CryptoFactory>();
+    crypto_factory->RegisterKmsClientFactory(kms_client_factory);

Review Comment:
   Nit: should we use std::move for kms_client_factory?



##########
cpp/src/parquet/encryption/key_management_test.cc:
##########
@@ -193,6 +193,26 @@ class TestEncryptionKeyManagement : public ::testing::Test 
{
     TestOnlyInServerWrapKms::FinishKeyRotation();
     crypto_factory_.RemoveCacheEntriesForAllTokens();
   }
+
+  // Create encryption properties without keeping the creating CryptoFactory 
alive
+  std::shared_ptr<FileEncryptionProperties> 
GetOrphanedFileEncryptionProperties(
+      std::shared_ptr<KmsClientFactory> kms_client_factory,
+      EncryptionConfiguration encryption_config) {
+    std::shared_ptr<CryptoFactory> crypto_factory = 
std::make_shared<CryptoFactory>();
+    crypto_factory->RegisterKmsClientFactory(kms_client_factory);
+    return crypto_factory->GetFileEncryptionProperties(kms_connection_config_,
+                                                       encryption_config);
+  }
+
+  // Create decryption properties without keeping the creating CryptoFactory 
alive
+  std::shared_ptr<FileDecryptionProperties> 
GetOrphanedFileDecryptionProperties(
+      std::shared_ptr<KmsClientFactory> kms_client_factory,
+      DecryptionConfiguration decryption_config) {
+    std::shared_ptr<CryptoFactory> crypto_factory = 
std::make_shared<CryptoFactory>();
+    crypto_factory->RegisterKmsClientFactory(kms_client_factory);

Review Comment:
   ditto



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