swamirishi commented on code in PR #9169:
URL: https://github.com/apache/ozone/pull/9169#discussion_r2446318329
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java:
##########
@@ -481,18 +491,32 @@ private boolean writeDBToArchive(Set<String>
sstFilesToExclude, Path dbDir, Atom
*
* @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.
+ * @return List of SST file Path objects.
* @throws IOException If an error occurs during checkpoint creation or file
copying.
*/
- private DBCheckpoint createAndPrepareCheckpoint(Path tmpdir, boolean flush)
throws IOException {
+ private DBCheckpoint createAndPrepareCheckpoint(Path tmpdir, boolean flush,
List<Path> sstFiles) throws IOException {
// make tmp directories to contain the copies
- Path tmpCompactionLogDir =
tmpdir.resolve(getCompactionLogDir().getFileName());
Path tmpSstBackupDir = tmpdir.resolve(getSstBackupDir().getFileName());
+ Files.createDirectories(tmpSstBackupDir);
- // Create checkpoint and then copy the files so that it has all the
compaction entries and files.
+ // Create checkpoint.
DBCheckpoint dbCheckpoint = getDbStore().getCheckpoint(flush);
- FileUtils.copyDirectory(getCompactionLogDir().toFile(),
tmpCompactionLogDir.toFile());
- OmSnapshotUtils.linkFiles(getSstBackupDir().toFile(),
tmpSstBackupDir.toFile());
+
+ try (OmMetadataManagerImpl checkpointMetadataManager =
Review Comment:
Let us move this loop outside this function maybe to another function. We
don't need to necessarily get the SstFiles here and we can call the new
function from caller function instead
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java:
##########
@@ -481,18 +491,32 @@ private boolean writeDBToArchive(Set<String>
sstFilesToExclude, Path dbDir, Atom
*
* @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.
+ * @return List of SST file Path objects.
* @throws IOException If an error occurs during checkpoint creation or file
copying.
*/
- private DBCheckpoint createAndPrepareCheckpoint(Path tmpdir, boolean flush)
throws IOException {
+ private DBCheckpoint createAndPrepareCheckpoint(Path tmpdir, boolean flush,
List<Path> sstFiles) throws IOException {
// make tmp directories to contain the copies
- Path tmpCompactionLogDir =
tmpdir.resolve(getCompactionLogDir().getFileName());
Path tmpSstBackupDir = tmpdir.resolve(getSstBackupDir().getFileName());
+ Files.createDirectories(tmpSstBackupDir);
Review Comment:
We are not using this tmpSstBackupDir anymore
--
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]