flyrain commented on a change in pull request #2520:
URL: https://github.com/apache/iceberg/pull/2520#discussion_r643564477



##########
File path: core/src/main/java/org/apache/iceberg/ManifestFiles.java
##########
@@ -121,34 +175,56 @@ private ManifestFiles() {
     throw new UnsupportedOperationException("Cannot write manifest for table 
version: " + formatVersion);
   }
 
+  /**
+   * @deprecated please use {@link #readDeleteManifest(ManifestFile, FileIO, 
EncryptionManager, Map)}
+   */
+  @Deprecated
+  public static ManifestReader<DeleteFile> readDeleteManifest(ManifestFile 
manifest, FileIO io,
+                                                              Map<Integer, 
PartitionSpec> specsById) {
+    return readDeleteManifest(manifest, io, EncryptionManagers.plainText(), 
specsById);
+  }
+
   /**
    * Returns a new {@link ManifestReader} for a {@link ManifestFile}.
    *
    * @param manifest a {@link ManifestFile}
    * @param io a {@link FileIO}
+   * @param encryption a {@link EncryptionManager}
    * @param specsById a Map from spec ID to partition spec
    * @return a {@link ManifestReader}
    */
   public static ManifestReader<DeleteFile> readDeleteManifest(ManifestFile 
manifest, FileIO io,
+                                                              
EncryptionManager encryption,
                                                               Map<Integer, 
PartitionSpec> specsById) {
     Preconditions.checkArgument(manifest.content() == ManifestContent.DELETES,
         "Cannot read a data manifest with a DeleteManifestReader: %s", 
manifest);
-    InputFile file = io.newInputFile(manifest.path());
+    InputFile file = encryption.decrypt(EncryptedFiles.encryptedInput(
+        io.newInputFile(manifest.path()), manifest.keyMetadata()));
     InheritableMetadata inheritableMetadata = 
InheritableMetadataFactory.fromManifest(manifest);
     return new ManifestReader<>(file, specsById, inheritableMetadata, 
FileType.DELETE_FILES);
   }
 
+  /**
+   * @deprecated please use {@link #writeDeleteManifest(int, PartitionSpec, 
EncryptedOutputFile, Long)}
+   */
+  @Deprecated
+  public static ManifestWriter<DeleteFile> writeDeleteManifest(int 
formatVersion, PartitionSpec spec,
+                                                               OutputFile 
outputFile, Long snapshotId) {
+    return writeDeleteManifest(formatVersion, spec,
+            EncryptedFiles.encryptedOutput(outputFile, 
EncryptionKeyMetadata.EMPTY), snapshotId);

Review comment:
       A nit: 4 spaces indentation rather than 8 spaces.




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

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