Skip to content

HDDS-14629. Code cleanup after HDDS-13906#9773

Open
Russole wants to merge 2 commits intoapache:masterfrom
Russole:HDDS-14629
Open

HDDS-14629. Code cleanup after HDDS-13906#9773
Russole wants to merge 2 commits intoapache:masterfrom
Russole:HDDS-14629

Conversation

@Russole
Copy link
Contributor

@Russole Russole commented Feb 16, 2026

What changes were proposed in this pull request?

  • Refactor OMDBArchiver to own and initialize the hardlink mapping internally, removing setHardLinkFileMap() and nullable state.
  • Normalize and convert paths to absolute form before calling relativize() in writeHardlinkFile to prevent abs/relative path mismatch exceptions.
  • Stop exposing internal hardlink map and use recordHardLinkMapping() instead.
  • Return HTTP 500 when archive streaming fails to ensure proper error handling.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14629

How was this patch tested?

path = getDbStore().getDbLocation().toPath().resolve(dbFile.getFileName()).toAbsolutePath().toString();
}
omdbArchiver.getHardLinkFileMap().put(path, fileId);
String path = dbFile.toFile().getAbsolutePath();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this one be null or empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dbFile comes from either Files.list(...) or from a List<Path> created in extractSSTFilesFromCompactionLog().

From directory listing:

try (Stream<Path> files = Files.list(dbDir)) {
  collectFilesFromDir(..., files, ...);
}

From compaction log (in extractSSTFilesFromCompactionLog()):

sstFiles.add(sstBackupDir.resolve(f.getFileName() + ROCKSDB_SST_SUFFIX));

In both cases, dbFile is a valid Path (no null elements). Also, Path.resolve() never returns null — it returns a Path or throws NullPointerException if the argument is null.

So dbFile.toFile().getAbsolutePath() cannot be null in this flow.

@Russole
Copy link
Contributor Author

Russole commented Feb 17, 2026

Thanks @yandrey321 for the review.

@Russole Russole requested a review from yandrey321 February 17, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants