ggershinsky commented on code in PR #17984:
URL: https://github.com/apache/iceberg/pull/17984#discussion_r3995492668


##########
core/src/main/java/org/apache/iceberg/encryption/StandardEncryptionManager.java:
##########
@@ -184,11 +184,21 @@ ByteBuffer encryptedByKey(String manifestListKeyID) {
     return unwrappedKeyCache().get(encryptedKeyMetadata.encryptedById());
   }
 
+  /**
+   * @deprecated since 1.12.0, will be removed in 1.13.0; use {@link
+   *     #addManifestListKeys(NativeEncryptionKeyMetadata)} instead.
+   */
+  @Deprecated
   public String addManifestListKeyMetadata(NativeEncryptionKeyMetadata 
keyMetadata) {
+    return addManifestListKeys(keyMetadata).manifestListKey().keyId();
+  }
+
+  /** Registers encrypted manifest-list key metadata and returns it with its 
wrapping key. */
+  public ManifestListEncryptionResult 
addManifestListKeys(NativeEncryptionKeyMetadata keyMetadata) {

Review Comment:
   "Keys" is plural, but we add a single key(metadata) here.



##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -113,6 +114,8 @@ public void accept(String file) {
   private MetricsReporter reporter = LoggingMetricsReporter.instance();
   private volatile Long snapshotId = null;
   private TableMetadata base;
+  // Encryption keys required by the manifest list written in the current 
commit attempt.
+  private ManifestListEncryptionResult manifestListEncryptionResult;

Review Comment:
   same here. Something like "manifestListKeys" or "snapshotKeys"?



##########
core/src/main/java/org/apache/iceberg/ManifestListWriter.java:
##########
@@ -36,6 +37,9 @@ abstract class ManifestListWriter implements 
FileAppender<ManifestFile> {
   private final StandardEncryptionManager standardEncryptionManager;
   private final NativeEncryptionKeyMetadata manifestListKeyMetadata;
   private final OutputFile outputFile;
+  private boolean closed = false;
+  private ManifestListFile manifestListFile;
+  private ManifestListEncryptionResult encryptionResult;

Review Comment:
   a field (and a class) named "result" sounds somewhat unclear to me. Maybe 
something like "encryptionKeys"?



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