chungen0126 commented on code in PR #4089:
URL: https://github.com/apache/ozone/pull/4089#discussion_r1054175845


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/TarContainerPacker.java:
##########
@@ -60,6 +60,42 @@
 
   private static final String CONTAINER_FILE_NAME = "container.yaml";
 
+  private final String compression;
+
+  private static final String NO_COMPRESSION = "no_compression";
+
+  public TarContainerPacker() {
+    this.compression = NO_COMPRESSION;
+  }
+
+  public TarContainerPacker(String compression) {
+    this.compression = compression;
+  }
+
+  private ArchiveInputStream getArchiveInputStream(InputStream input)
+      throws CompressorException {
+    ArchiveInputStream archiveInput;
+    if (compression == NO_COMPRESSION) {
+      archiveInput = untar(input);
+    } else {
+      InputStream decompressed = decompress(input);
+      archiveInput = untar(decompressed);
+    }
+    return archiveInput;
+  }
+
+  private ArchiveOutputStream getArchiveOutputStream(OutputStream output)
+      throws CompressorException {
+    ArchiveOutputStream archiveOutput;
+    if (compression == NO_COMPRESSION) {
+      archiveOutput = tar(output);
+    } else {
+      OutputStream compressed = compress(output);
+      archiveOutput = tar(compressed);
+    }
+    return archiveOutput;
+  }

Review Comment:
   finished



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