errose28 commented on a change in pull request #1549:
URL: https://github.com/apache/ozone/pull/1549#discussion_r519838339



##########
File path: 
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestSchemaOneBackwardsCompatibility.java
##########
@@ -269,29 +272,29 @@ public void testDelete() throws Exception {
    */
   @Test
   public void testReadDeletedBlockChunkInfo() throws Exception {
-    try(ReferenceCountedDB refCountedDB = BlockUtils.getDB(newKvData(), conf)) 
{
+    KeyValueContainerData kvData = newKvData();
+    List<? extends Table.KeyValue<String, ChunkInfoList>> deletedBlocks;
+    Set<String> preUpgradeBlocks = new HashSet<>();
+    try(ReferenceCountedDB refCountedDB = BlockUtils.getDB(kvData, conf)) {
       // Read blocks that were already deleted before the upgrade.
-      List<? extends Table.KeyValue<String, ChunkInfoList>> deletedBlocks =
-              refCountedDB.getStore()
-                      .getDeletedBlocksTable().getRangeKVs(null, 100);
-
-      Set<String> preUpgradeBlocks = new HashSet<>();
+      deletedBlocks = refCountedDB.getStore()
+          .getDeletedBlocksTable().getRangeKVs(null, 100);
 
-      for(Table.KeyValue<String, ChunkInfoList> chunkListKV: deletedBlocks) {
+      for (Table.KeyValue<String, ChunkInfoList> chunkListKV : deletedBlocks) {
         preUpgradeBlocks.add(chunkListKV.getKey());
         try {
           chunkListKV.getValue();
           Assert.fail("No exception thrown when trying to retrieve old " +
-                  "deleted blocks values as chunk lists.");
-        } catch(IOException ex) {
+              "deleted blocks values as chunk lists.");
+        } catch (IOException ex) {
           // Exception thrown as expected.
         }
       }
+    }
 
-      Assert.assertEquals(TestDB.NUM_DELETED_BLOCKS, preUpgradeBlocks.size());

Review comment:
       What is the reason for removing this assertion, and opening a new 
ReferenceCountedDB after running the block deleting service?

##########
File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStore.java
##########
@@ -47,7 +47,7 @@
    */
   void stop() throws Exception;
 
-  /**
+  /**TestSchemaOneBackwardsCompatibility.java

Review comment:
       I think this is a typo.




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

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