ccaominh commented on a change in pull request #8748: Use earliest offset on 
kafka newly discovered partitions
URL: https://github.com/apache/incubator-druid/pull/8748#discussion_r343254505
 
 

 ##########
 File path: 
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/supervisor/KafkaSupervisorTest.java
 ##########
 @@ -3668,6 +3840,59 @@ public TestableKafkaSupervisor(
           spec,
           rowIngestionMetersFactory
       );
+      this.consumerProperties = spec.getIoConfig().getConsumerProperties();
+    }
+
+    @Override
+    protected RecordSupplier<Integer, Long> setupRecordSupplier()
+    {
+      final Map<String, Object> consumerConfigs = new HashMap<>();
+      consumerConfigs.put("metadata.max.age.ms", "1");
+      consumerConfigs.put("group.id", 
StringUtils.format("kafka-supervisor-%s", RandomIdUtils.getRandomId()));
+      consumerConfigs.put("auto.offset.reset", "none");
+      consumerConfigs.put("enable.auto.commit", "false");
+      consumerConfigs.put("isolation.level", "read_committed");
+      final Properties props = new Properties();
+      consumerProperties.get("key.deserializer");
+      System.out.println("consumerProperties");
+      consumerProperties.forEach((key, value) -> System.out.println(key + ":" 
+ value));
+      KafkaRecordSupplier.addConsumerPropertiesFromConfig(props, 
sortingMapper, consumerProperties);
+      props.putAll(consumerConfigs);
+      Deserializer keyDeserializerObject = getKafkaDeserializer(props, 
"key.deserializer");
+      Deserializer valueDeserializerObject = getKafkaDeserializer(props, 
"value.deserializer");
 
 Review comment:
   You can simplify the test code by directly instantiating the deserializer 
here:
   ```java
         Deserializer keyDeserializerObject = new ByteArrayDeserializer();
         Deserializer valueDeserializerObject = new ByteArrayDeserializer();
   ```
   
   and then delete the `getKafkaDeserializer()` method you added.

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


With regards,
Apache Git Services

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

Reply via email to