adoroszlai commented on code in PR #4130:
URL: https://github.com/apache/ozone/pull/4130#discussion_r1060505094
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/DBCheckpointServlet.java:
##########
@@ -171,7 +168,7 @@ public void doGet(HttpServletRequest request,
HttpServletResponse response) {
response.setContentType("application/x-tgz");
Review Comment:
```suggestion
response.setContentType("application/x-tar");
```
Also update related tests:
```
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServlet.java
182: doNothing().when(responseMock).setContentType("application/x-tgz");
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java
129: doNothing().when(responseMock).setContentType("application/x-tgz");
```
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java:
##########
@@ -107,20 +105,17 @@ public File getReconDbDir(ConfigurationSource conf,
String dirConfigKey) {
* Given a source directory, create a tar.gz file from it.
Review Comment:
```suggestion
* Given a source directory, create a tar file from it.
```
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/DBCheckpointServlet.java:
##########
@@ -211,30 +208,21 @@ public static void writeDBCheckpointToStream(DBCheckpoint
checkpoint,
OutputStream destination)
throws IOException {
- try (CompressorOutputStream gzippedOut = new CompressorStreamFactory()
- .createCompressorOutputStream(CompressorStreamFactory.GZIP,
- destination)) {
-
- try (ArchiveOutputStream archiveOutputStream =
- new TarArchiveOutputStream(gzippedOut)) {
-
- Path checkpointPath = checkpoint.getCheckpointLocation();
- try (Stream<Path> files = Files.list(checkpointPath)) {
- for (Path path : files.collect(Collectors.toList())) {
- if (path != null) {
- Path fileName = path.getFileName();
- if (fileName != null) {
- includeFile(path.toFile(), fileName.toString(),
- archiveOutputStream);
- }
+ try (ArchiveOutputStream archiveOutputStream =
+ new TarArchiveOutputStream(destination)) {
+
+ Path checkpointPath = checkpoint.getCheckpointLocation();
+ try (Stream<Path> files = Files.list(checkpointPath)) {
+ for (Path path : files.collect(Collectors.toList())) {
+ if (path != null) {
+ Path fileName = path.getFileName();
+ if (fileName != null) {
+ includeFile(path.toFile(), fileName.toString(),
+ archiveOutputStream);
Review Comment:
This method and its helper `includeFile` are duplicated between
`HddsServerUtil` and `DBCheckpointServlet`. Can you please remove one of them?
Also, please update the method comment (`as a compressed file (tgz)`) and
class comment (`(tar.gz)`).
--
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]