Skip to content

Commit

Permalink
Added a comment and renamed the function
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantk-12 committed May 8, 2024
1 parent 83113f7 commit de0ef06
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ private boolean getFilesForArchive(DBCheckpoint checkpoint,

// Get the snapshot files.
Set<Path> snapshotPaths = waitForSnapshotDirs(checkpoint);
Path snapshotDir = Paths.get(getSnapshotsParentDir()).getParent();
Path snapshotDir = getSnapshotDir();
if (!processDir(snapshotDir, copyFiles, hardLinkFiles, sstFilesToExclude,
snapshotPaths, excluded, copySize, null)) {
return false;
Expand Down Expand Up @@ -635,10 +635,13 @@ private OzoneConfiguration getConf() {
.getConfiguration();
}

private String getSnapshotsParentDir() {
private Path getSnapshotDir() {
OzoneManager om = (OzoneManager) getServletContext().getAttribute(OzoneConsts.OM_CONTEXT_ATTRIBUTE);
RDBStore store = (RDBStore) om.getMetadataManager().getStore();
return store.getSnapshotsParentDir();
// store.getSnapshotsParentDir() returns path to checkpointState (e.g. <om-data-dir>/db.snapshots/checkpointState)
// But we need to return path till db.snapshots which contains checkpointState and diffState.
// So that whole snapshots and compaction information can be transferred to follower.
return Paths.get(store.getSnapshotsParentDir()).getParent();
}

@Override
Expand Down

0 comments on commit de0ef06

Please sign in to comment.