FrankChen021 commented on code in PR #20479:
URL: https://github.com/apache/druid/pull/20479#discussion_r4181128638
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/simulate/EmbeddedKafkaSupervisorTest.java:
##########
@@ -196,16 +217,21 @@ public void test_runSupervisor_withEmptyDimension()
final String emptyColumn = "unknownColumn";
final KafkaSupervisorSpec supervisorSpec = newKafkaSupervisor()
+ .withTuningConfig(tuningConfig ->
tuningConfig.withMaxRowsPerSegment(null))
Review Comment:
add some concise comment to explain the purposes of these two 'withXXX' call
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/simulate/EmbeddedKafkaSupervisorTest.java:
##########
@@ -196,16 +217,21 @@ public void test_runSupervisor_withEmptyDimension()
final String emptyColumn = "unknownColumn";
final KafkaSupervisorSpec supervisorSpec = newKafkaSupervisor()
+ .withTuningConfig(tuningConfig ->
tuningConfig.withMaxRowsPerSegment(null))
+ .withIoConfig(ioConfig -> ioConfig.withTaskDuration(Period.minutes(1)))
.withDataSchema(
s -> s.withDimensions(
DimensionsSpec.getDefaultSchemas(List.of(emptyColumn,
COL_ITEM))
)
)
.build(dataSource, topic);
- cluster.callApi().postSupervisor(supervisorSpec);
+ submitSupervisor(supervisorSpec);
final int numRows = 100;
- kafkaServer.produceRecordsToTopic(generateRecordsForTopic(topic, numRows,
DateTimes.nowUtc()));
+ // Empty-dimension handling does not require a separate segment for every
row.
+ kafkaServer.produceRecordsToTopic(
+ generateRecordsForTopic(topic, numRows, DateTimes.of("2025-06-01"),
Period.seconds(1))
Review Comment:
add a concise comment to explain why the step is 1s in this test case
##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/simulate/EmbeddedKafkaSupervisorTest.java:
##########
@@ -260,17 +292,41 @@ private KafkaSupervisorSpecBuilder newKafkaSupervisor()
);
}
+ private String submitSupervisor(final KafkaSupervisorSpec spec)
+ {
+ supervisorSpec = spec;
+ return cluster.callApi().postSupervisor(spec);
+ }
+
+ private List<TaskStatusPlus> getActiveTasks()
+ {
+ return ImmutableList.copyOf(
+ (CloseableIterator<TaskStatusPlus>)
+ cluster.callApi().onLeaderOverlord(o -> o.taskStatuses(null,
dataSource, 0))
+ );
+ }
+
private List<ProducerRecord<byte[], byte[]>> generateRecordsForTopic(
String topic,
int numRecords,
DateTime startTime
)
+ {
+ return generateRecordsForTopic(topic, numRecords, startTime,
Period.days(1));
Review Comment:
explain why the step is 1 day
--
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]