swamirishi commented on code in PR #9169:
URL: https://github.com/apache/ozone/pull/9169#discussion_r2453751196
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java:
##########
@@ -480,21 +479,33 @@ private boolean writeDBToArchive(Set<String>
sstFilesToExclude, Path dbDir, Atom
* The copy to the temporary directory for compaction log and SST backup
files
* is done to maintain a consistent view of the files in these directories.
*
- * @param tmpdir Temporary directory for storing checkpoint-related files.
* @param flush If true, flushes in-memory data to disk before
checkpointing.
- * @return The created database checkpoint.
* @throws IOException If an error occurs during checkpoint creation or file
copying.
*/
- private DBCheckpoint createAndPrepareCheckpoint(Path tmpdir, boolean flush)
throws IOException {
- // make tmp directories to contain the copies
- Path tmpCompactionLogDir =
tmpdir.resolve(getCompactionLogDir().getFileName());
- Path tmpSstBackupDir = tmpdir.resolve(getSstBackupDir().getFileName());
+ private DBCheckpoint createAndPrepareCheckpoint(boolean flush) throws
IOException {
+ // Create & return the checkpoint.
+ return getDbStore().getCheckpoint(flush);
+ }
+
+ private List<Path> extractSSTFilesFromCompactionLog(DBCheckpoint
dbCheckpoint) throws IOException {
+ List<Path> sstFiles = new ArrayList<>();
+ try (OmMetadataManagerImpl checkpointMetadataManager =
+ OmMetadataManagerImpl.createCheckpointMetadataManager(getConf(),
dbCheckpoint)) {
+ try (Table.KeyValueIterator<String, CompactionLogEntry>
+ iterator =
checkpointMetadataManager.getCompactionLogTable().iterator()) {
+ iterator.seekToFirst();
- // Create checkpoint and then copy the files so that it has all the
compaction entries and files.
- DBCheckpoint dbCheckpoint = getDbStore().getCheckpoint(flush);
- FileUtils.copyDirectory(getCompactionLogDir().toFile(),
tmpCompactionLogDir.toFile());
- OmSnapshotUtils.linkFiles(getSstBackupDir().toFile(),
tmpSstBackupDir.toFile());
+ Path sstBackupDir = getSstBackupDir();
- return dbCheckpoint;
+ while (iterator.hasNext()) {
+ CompactionLogEntry logEntry = iterator.next().getValue();
+ logEntry.getInputFileInfoList().forEach(f ->
+ sstFiles.add(sstBackupDir.resolve(f.getFileName() + ".sst")));
Review Comment:
```suggestion
sstFiles.add(sstBackupDir.resolve(f.getFileName() +
ROCKSDB_SST_SUFFIX)));
```
--
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]