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


##########
core/src/main/java/org/apache/iceberg/deletes/BaseDVFileWriter.java:
##########
@@ -52,20 +57,27 @@ public class BaseDVFileWriter implements DVFileWriter {
   private static final String REFERENCED_DATA_FILE_KEY = 
"referenced-data-file";
   private static final String CARDINALITY_KEY = "cardinality";
 
-  private final Supplier<OutputFile> dvOutputFile;
+  private final Supplier<EncryptedOutputFile> dvOutputFile;
   private final Function<String, PositionDeleteIndex> loadPreviousDeletes;
   private final Map<String, Deletes> deletesByPath = Maps.newHashMap();
   private final Map<String, BlobMetadata> blobsByPath = Maps.newHashMap();
+  private EncryptionKeyMetadata keyMetadata = null;
   private DeleteWriteResult result = null;
 
   public BaseDVFileWriter(
       OutputFileFactory fileFactory, Function<String, PositionDeleteIndex> 
loadPreviousDeletes) {
-    this(() -> fileFactory.newOutputFile().encryptingOutputFile(), 
loadPreviousDeletes);
+    this(loadPreviousDeletes, fileFactory::newOutputFile);
   }
 
   public BaseDVFileWriter(
       Supplier<OutputFile> dvOutputFile,
       Function<String, PositionDeleteIndex> loadPreviousDeletes) {
+    this(loadPreviousDeletes, () -> 
EncryptedFiles.plainAsEncryptedOutput(dvOutputFile.get()));

Review Comment:
   what code calls this constructor? It won't be encrypting the file.
   If this is testing only, please add a comment. If nothing calls it, can be 
deprecated.



##########
core/src/main/java/org/apache/iceberg/deletes/BaseDVFileWriter.java:
##########
@@ -151,6 +163,7 @@ private DeleteFile createDV(String path, long size, String 
referencedDataFile) {
         .withPath(path)
         .withPartition(deletes.partition())
         .withFileSizeInBytes(size)
+        .withEncryptionKeyMetadata(keyMetadata(size))

Review Comment:
   this can be confusing, please rename the function to something like 
keyMetadataWithFileSize



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