tom-s-powell commented on code in PR #14751:
URL: https://github.com/apache/iceberg/pull/14751#discussion_r2598387436


##########
core/src/main/java/org/apache/iceberg/encryption/StandardEncryptionManager.java:
##########
@@ -145,42 +137,37 @@ private SecureRandom workerRNG() {
    */
   @Deprecated
   public ByteBuffer wrapKey(ByteBuffer secretKey) {
-    if (transientState == null) {
-      throw new IllegalStateException(
-          "Cannot wrap key after called after serialization (missing KMS 
client)");
-    }
-
-    return transientState.kmsClient.wrapKey(secretKey, tableKeyId);
+    return kmsClient.wrapKey(secretKey, tableKeyId);
   }
 
   /**
    * @deprecated will be removed in 2.0.
    */
   @Deprecated
   public ByteBuffer unwrapKey(ByteBuffer wrappedSecretKey) {
-    if (transientState == null) {
-      throw new IllegalStateException("Cannot unwrap key after serialization");
+    return kmsClient.unwrapKey(wrappedSecretKey, tableKeyId);
+  }
+
+  private ByteBuffer unwrapKey(String keyId) {
+    if (unwrappedKeyCache != null) {

Review Comment:
   I figured it was perhaps not a code path that would meaningfully benefit 
from the cache, but I've added that now.



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