errose28 commented on a change in pull request #1298: URL: https://github.com/apache/hadoop-ozone/pull/1298#discussion_r482287093
########## File path: hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueBlockIterator.java ########## @@ -88,196 +86,314 @@ public void setUp() throws Exception { conf = new OzoneConfiguration(); conf.set(HDDS_DATANODE_DIR_KEY, testRoot.getAbsolutePath()); volumeSet = new MutableVolumeSet(UUID.randomUUID().toString(), conf); + + containerData = new KeyValueContainerData(105L, + layout, + (long) StorageUnit.GB.toBytes(1), UUID.randomUUID().toString(), + UUID.randomUUID().toString()); + // Init the container. + container = new KeyValueContainer(containerData, conf); + container.create(volumeSet, new RoundRobinVolumeChoosingPolicy(), UUID + .randomUUID().toString()); + db = BlockUtils.getDB(containerData, conf); } @After - public void tearDown() { + public void tearDown() throws Exception { + db.close(); + db.cleanup(); volumeSet.shutdown(); FileUtil.fullyDelete(testRoot); } @Test public void testKeyValueBlockIteratorWithMixedBlocks() throws Exception { - - long containerID = 100L; - int deletedBlocks = 5; + int deletingBlocks = 5; int normalBlocks = 5; - createContainerWithBlocks(containerID, normalBlocks, deletedBlocks); - String containerPath = new File(containerData.getMetadataPath()) - .getParent(); - try(KeyValueBlockIterator keyValueBlockIterator = new KeyValueBlockIterator( - containerID, new File(containerPath))) { + Map<String, List<Long>> blockIDs = createContainerWithBlocks(CONTAINER_ID, + normalBlocks, + deletingBlocks); Review comment: Not sure why lines 115-116 are split up, I will combine them. Looking at the continuation spacing for the rest of this file, it looks like continuation of method params (separated by comma like in this case) are using 8, but continuation of String literals are using 4 (see lines 142 and 161). Not sure why that is, I can make it whatever. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org