TSFenwick commented on code in PR #15907:
URL: https://github.com/apache/druid/pull/15907#discussion_r1489972455
##########
extensions-contrib/kafka-emitter/src/test/java/org/apache/druid/emitter/kafka/KafkaEmitterTest.java:
##########
@@ -509,57 +511,56 @@ private List<Event> flattenEvents(List<Event>...
eventLists)
return flattenedList;
}
- private Map<String, List<String>> trackActualEventsPerFeed(
+ private Map<String, List<EventMap>> trackActualEventsPerFeed(
final CountDownLatch eventLatch
)
{
- final Map<String, List<String>> feedToActualEvents = new HashMap<>();
+ final Map<String, List<EventMap>> feedToActualEvents = new HashMap<>();
when(producer.send(any(), any())).then((invocation) -> {
final ProducerRecord<?, ?> producerRecord = invocation.getArgument(0);
final String value = String.valueOf(producerRecord.value());
final EventMap eventMap = MAPPER.readValue(value, EventMap.class);
feedToActualEvents.computeIfAbsent(
(String) eventMap.get("feed"), k -> new ArrayList<>()
- ).add(value);
+ ).add(eventMap);
eventLatch.countDown();
return null;
});
return feedToActualEvents;
}
- private Map<String, List<String>> trackExpectedEventsPerFeed(
+ private Map<String, List<EventMap>> trackExpectedEventsPerFeed(
final List<Event> events,
final String clusterName,
final Map<String, String> extraDimensions
) throws JsonProcessingException
{
- final Map<String, List<String>> feedToExpectedEvents = new HashMap<>();
+ final Map<String, List<EventMap>> feedToExpectedEvents = new HashMap<>();
for (final Event event : events) {
final EventMap eventMap = event.toMap();
eventMap.computeIfAbsent("clusterName", k -> clusterName);
Review Comment:
instead of adding the toString to dateTimes and getStats to the objects in
the toMap() i can instead do this
```java
final EventMap eventMap =
MAPPER.readValue(MAPPER.writeValueAsString(event.toMap());
```
--
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]