swamirishi commented on code in PR #9423:
URL: https://github.com/apache/ozone/pull/9423#discussion_r2612109391
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java:
##########
@@ -1723,6 +1727,208 @@ public void testPreviousSnapshotOzoneDirInfo() throws
IOException {
assertNull(km.getPreviousSnapshotOzoneDirInfo(volumeId, bucketInfo,
currentKeyDir4).apply(prevKM));
}
+ @Test
+ public void testGetPendingDeletionSubFilesAllReclaimableNoLimit() throws
Exception {
Review Comment:
Why add in integration test module? Add it in ozone manager module
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java:
##########
@@ -1723,6 +1727,208 @@ public void testPreviousSnapshotOzoneDirInfo() throws
IOException {
assertNull(km.getPreviousSnapshotOzoneDirInfo(volumeId, bucketInfo,
currentKeyDir4).apply(prevKM));
}
+ @Test
+ public void testGetPendingDeletionSubFilesAllReclaimableNoLimit() throws
Exception {
+ OzoneConfiguration configuration = new OzoneConfiguration();
+ OMMetadataManager omMetadataManager =
Mockito.mock(OMMetadataManager.class);
+ KeyManagerImpl km = new KeyManagerImpl(null, null, omMetadataManager,
configuration, null, null, null);
+
+ String prefix = "/vol1/buck1/dir1/";
+ java.util.NavigableMap<String, OmKeyInfo> values = new
java.util.TreeMap<>();
+ // Three reclaimable children under the same parent
+ OmKeyInfo f1 = OMRequestTestUtils.createOmKeyInfo("vol1", "buck1",
"file1", null).build();
+ OmKeyInfo f2 = OMRequestTestUtils.createOmKeyInfo("vol1", "buck1",
"file2", null).build();
+ OmKeyInfo f3 = OMRequestTestUtils.createOmKeyInfo("vol1", "buck1",
"file3", null).build();
+ values.put(prefix + "file1", f1);
+ values.put(prefix + "file2", f2);
+ values.put(prefix + "file3", f3);
+
+ @SuppressWarnings("unchecked") Table<String, OmKeyInfo> fileTable =
Mockito.mock(Table.class);
+ mockTableWithEntries(omMetadataManager, fileTable, "getFileTable", prefix,
values);
Review Comment:
Use StringInMemoryTable class instead
--
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]