You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/05/19 03:51:01 UTC

[GitHub] [druid] kfaraz commented on a diff in pull request #12539: Add builder for TaskToolbox.

kfaraz commented on code in PR #12539:
URL: https://github.com/apache/druid/pull/12539#discussion_r876568327


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/TaskToolbox.java:
##########
@@ -50,6 +51,7 @@
 import org.apache.druid.query.QueryRunnerFactoryConglomerate;
 import org.apache.druid.segment.IndexIO;
 import org.apache.druid.segment.IndexMergerV9;
+import org.apache.druid.segment.IndexMergerV9;

Review Comment:
   Nit: extra import.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/CompactionTaskTest.java:
##########
@@ -428,7 +432,11 @@ public void testCreateCompactionTaskWithConflictingGranularitySpecAndSegmentGran
   @Test
   public void testCreateCompactionTaskWithTransformSpec()
   {
-    ClientCompactionTaskTransformSpec transformSpec = new ClientCompactionTaskTransformSpec(new SelectorDimFilter("dim1", "foo", null));
+    ClientCompactionTaskTransformSpec transformSpec = new ClientCompactionTaskTransformSpec(new SelectorDimFilter(

Review Comment:
   Super nit: It would be easier to read if the whole of `new SelectorDimFilter(...)` was in a single new line.



##########
indexing-service/src/test/java/org/apache/druid/indexing/common/task/BatchAppenderatorsTest.java:
##########
@@ -560,71 +560,39 @@ public String toString()
       }
     }
 
-
-    private static class TestTaskToolbox extends TaskToolbox
+    private static TaskToolbox makeTaskToolbox(
+        ObjectMapper mapper,
+        IndexMergerV9 indexMergerV9,
+        TaskConfig.BatchProcessingMode mode
+    )
     {
-      private final Map<DataSegment, File> segmentFileMap;
-
-      TestTaskToolbox(ObjectMapper mapper, IndexMergerV9 indexMergerV9, TaskConfig.BatchProcessingMode mode)
-      {
-        super(
-            new TaskConfig(
-                null,
-                null,
-                null,
-                null,
-                null,
-                false,
-                null,
-                null,
-                null,
-                false,
-                false,
-                mode.name(),
-                null
-            ),
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            NoopJoinableFactory.INSTANCE,
-            null,
-            null,
-            mapper,
-            null,
-            new IndexIO(
-                new ObjectMapper(),
-                () -> 0
-            ),
-            null,
-            null,
-            null,
-            indexMergerV9,
-            null,
-            null,
-            null,
-            null,
-            new NoopTestTaskReportFileWriter(),
-            null,
-            AuthTestUtils.TEST_AUTHORIZER_MAPPER,
-            new NoopChatHandlerProvider(),
-            null,
-            new TestAppenderatorsManager(),
-            null,
-            null,
-            null,
-            null
-        );
-        this.segmentFileMap = null;
-      }
+      return new TaskToolbox.Builder()
+          .config(
+              new TaskConfig(

Review Comment:
   Is TaskConfig.Builder next? 🙂



-- 
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: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org