You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "hemantk-12 (via GitHub)" <gi...@apache.org> on 2023/09/07 23:03:50 UTC

[GitHub] [ozone] hemantk-12 commented on a diff in pull request #5236: HDDS-8940. SST files are missing on optimized snapDiff path.

hemantk-12 commented on code in PR #5236:
URL: https://github.com/apache/ozone/pull/5236#discussion_r1319195269


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -555,38 +567,9 @@ public void onCompactionCompleted(RocksDB db,
               .append('\n');
         }
 
-        // Mark the beginning of a compaction log
-        sb.append(COMPACTION_LOG_ENTRY_LINE_PREFIX);
-        sb.append(db.getLatestSequenceNumber());
-        sb.append(SPACE_DELIMITER);
-
-        // Trim DB path, only keep the SST file name
-        final int filenameOffset =
-            compactionJobInfo.inputFiles().get(0).lastIndexOf("/") + 1;
-
-        // Append the list of input files
-        final List<String> inputFiles = compactionJobInfo.inputFiles();
-        // Trim the file path, leave only the SST file name without extension
-        inputFiles.replaceAll(s -> s.substring(
-            filenameOffset, s.length() - SST_FILE_EXTENSION_LENGTH));
-        final String inputFilesJoined =
-            String.join(COMPACTION_LOG_ENTRY_FILE_DELIMITER, inputFiles);
-        sb.append(inputFilesJoined);
-
-        // Insert delimiter between input files and output files
-        sb.append(COMPACTION_LOG_ENTRY_INPUT_OUTPUT_FILES_DELIMITER);
-
-        // Append the list of output files
-        final List<String> outputFiles = compactionJobInfo.outputFiles();
-        outputFiles.replaceAll(s -> s.substring(
-            filenameOffset, s.length() - SST_FILE_EXTENSION_LENGTH));
-        final String outputFilesJoined =
-            String.join(COMPACTION_LOG_ENTRY_FILE_DELIMITER, outputFiles);
-        sb.append(outputFilesJoined);
-
-        // End of line
+        sb.append(COMPACTION_LOG_ENTRY_LINE_PREFIX_V1);
+        sb.append(compactionLogEntry.toEncodedString());
         sb.append('\n');

Review Comment:
   It is a good idea to use `ColumnFamily` and will address [HDDS-7601](https://issues.apache.org/jira/browse/HDDS-7601) as well. Let me think about it and see if it will cause any issue in bootstrapping. If using `ColumnFamily` doesn't cause any problem, I'll make the changes according. Otherwise will continue using Compaction log file.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org