Russole commented on code in PR #9773:
URL: https://github.com/apache/ozone/pull/9773#discussion_r2814829083


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java:
##########
@@ -500,14 +502,12 @@ private boolean collectFilesFromDir(Set<String> 
sstFilesToExclude, Stream<Path>
           continue;
         }
         String fileId = 
OmSnapshotUtils.getFileInodeAndLastModifiedTimeString(dbFile);
-        if (omdbArchiver.getHardLinkFileMap() != null) {
-          String path = dbFile.toFile().getAbsolutePath();
-          // if the file is in the om checkpoint dir, then we need to change 
the path to point to the OM DB.
-          if (path.contains(OM_CHECKPOINT_DIR)) {
-            path = 
getDbStore().getDbLocation().toPath().resolve(dbFile.getFileName()).toAbsolutePath().toString();
-          }
-          omdbArchiver.getHardLinkFileMap().put(path, fileId);
+        String path = dbFile.toFile().getAbsolutePath();

Review Comment:
   `dbFile` comes from either `Files.list(...)` or from a `List<Path>` created 
in `extractSSTFilesFromCompactionLog()`.
   
   From directory listing:
   
   ```java
   try (Stream<Path> files = Files.list(dbDir)) {
     collectFilesFromDir(..., files, ...);
   }
   ```
   
   From compaction log (in `extractSSTFilesFromCompactionLog()`):
   
   ```java
   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.
   



-- 
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]

Reply via email to