You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "hemantk-12 (via GitHub)" <gi...@apache.org> on 2023/05/02 23:32:23 UTC

[GitHub] [ozone] hemantk-12 commented on a diff in pull request #4584: HDDS-8306. [Snapshot] Add tests for SST dump tool

hemantk-12 commented on code in PR #4584:
URL: https://github.com/apache/ozone/pull/4584#discussion_r1183133786


##########
hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestManagedSSTDumpIterator.java:
##########
@@ -0,0 +1,109 @@
+package org.apache.hadoop.hdds.utils.db.managed;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+import java.util.Optional;
+import java.util.TreeMap;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
+
+/**
+ * Test for ManagedSSTDumpIterator.
+ */
+public class TestManagedSSTDumpIterator {
+
+  private void testSSTDumpIteratorWithKeys(
+      Map<Pair<String, Integer>, String> records)
+      throws Exception {
+    Map<Pair<String, Integer>, String> keys = records instanceof TreeMap ?

Review Comment:
   1. These tests could be changed in to parameterized test.
   2. If you expect `records` to be an instance of `TreeMap`, wouldn't it be better for requested to send a `TreeMap` itself.
   3. I don't get (or like) idea of using `Pair<String, Integer>` as key. It could be simplified if you use parameterized tests.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org