rdblue commented on code in PR #7770:
URL: https://github.com/apache/iceberg/pull/7770#discussion_r1701019686


##########
core/src/main/java/org/apache/iceberg/encryption/EncryptionUtil.java:
##########
@@ -70,31 +76,105 @@ public static KeyManagementClient 
createKmsClient(Map<String, String> catalogPro
     return kmsClient;
   }
 
+  /**
+   * @deprecated will be removed in 2.0.0. use {@link 
#createEncryptionManager(String, int,
+   *     KeyManagementClient, long)} instead.
+   */
+  @Deprecated
   public static EncryptionManager createEncryptionManager(
       Map<String, String> tableProperties, KeyManagementClient kmsClient) {
-    Preconditions.checkArgument(kmsClient != null, "Invalid KMS client: null");
     String tableKeyId = 
tableProperties.get(TableProperties.ENCRYPTION_TABLE_KEY);
-
-    if (null == tableKeyId) {
-      // Unencrypted table
-      return PlaintextEncryptionManager.instance();
-    }
-
     int dataKeyLength =
         PropertyUtil.propertyAsInt(
             tableProperties,
             TableProperties.ENCRYPTION_DEK_LENGTH,
             TableProperties.ENCRYPTION_DEK_LENGTH_DEFAULT);
 
+    return createEncryptionManager(
+        tableKeyId, dataKeyLength, kmsClient, 
CatalogProperties.KEK_CACHE_TIMEOUT_MS_DEFAULT);
+  }
+
+  public static EncryptionManager createEncryptionManager(

Review Comment:
   Now that this is passing extra options, it seems like this should just use 
the original method signature that extracts the key length and other settings 
(like cache timeout).



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to