sadanand48 commented on code in PR #8761:
URL: https://github.com/apache/ozone/pull/8761#discussion_r2217710197
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java:
##########
@@ -417,44 +415,16 @@ public void testGetSnapshotInfo() throws IOException {
@Test
public void testExcludeUtilities() throws IOException {
File noLinkFile = new File(followerSnapDir2, "noLink.sst");
-
+ File nonSstFile = new File(followerSnapDir2, "nonSstFile");
// Confirm that the list of existing sst files is as expected.
- List<String> existingSstList = getExistingSstFiles(candidateDir);
+ List<String> existingSstList = getExistingFiles(candidateDir);
Set<String> existingSstFiles = new HashSet<>(existingSstList);
- int truncateLength = candidateDir.toString().length() + 1;
- Set<String> expectedSstFiles = new HashSet<>(Arrays.asList(
- s1File.toString().substring(truncateLength),
- noLinkFile.toString().substring(truncateLength),
- f1File.toString().substring(truncateLength)));
- assertEquals(expectedSstFiles, existingSstFiles);
-
- // Confirm that the excluded list is normalized as expected.
- // (Normalizing means matches the layout on the leader.)
- File leaderSstBackupDir = new File(leaderDir.toString(), "sstBackup");
- assertTrue(leaderSstBackupDir.mkdirs());
- File leaderTmpDir = new File(leaderDir.toString(), "tmp");
- assertTrue(leaderTmpDir.mkdirs());
- OMDBCheckpointServlet.DirectoryData sstBackupDir =
- new OMDBCheckpointServlet.DirectoryData(leaderTmpDir.toPath(),
- leaderSstBackupDir.toString());
- Path srcSstBackup = Paths.get(sstBackupDir.getTmpDir().toString(),
- "backup.sst");
- Path destSstBackup = Paths.get(sstBackupDir.getOriginalDir().toString(),
- "backup.sst");
- truncateLength = leaderDir.toString().length() + 1;
- existingSstList.add(truncateFileName(truncateLength, destSstBackup));
- Map<String, Map<Path, Path>> normalizedMap =
- OMDBCheckpointServlet.normalizeExcludeList(existingSstList,
- leaderCheckpointDir.toPath(), sstBackupDir);
- Map<String, Map<Path, Path>> expectedMap = new TreeMap<>();
- Path s1 = Paths.get(leaderSnapDir1.toString(), "s1.sst");
- Path noLink = Paths.get(leaderSnapDir2.toString(), "noLink.sst");
- Path f1 = Paths.get(leaderCheckpointDir.toString(), "f1.sst");
- expectedMap.put("s1.sst", ImmutableMap.of(s1, s1));
- expectedMap.put("noLink.sst", ImmutableMap.of(noLink, noLink));
- expectedMap.put("f1.sst", ImmutableMap.of(f1, f1));
- expectedMap.put("backup.sst", ImmutableMap.of(srcSstBackup,
destSstBackup));
- assertEquals(expectedMap, new TreeMap<>(normalizedMap));
Review Comment:
removed this part as the exclude list logic is simplified in the new
implementation and we only send fileNames that have been received.
--
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]