Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
harinirajendran committed Nov 1, 2022
1 parent 3951bf1 commit 3c45762
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
package org.apache.druid.java.util.emitter.service;

import com.fasterxml.jackson.annotation.JsonValue;
import com.google.common.collect.ImmutableMap;
import org.apache.druid.java.util.emitter.core.Event;
import org.apache.druid.java.util.emitter.core.EventMap;
import org.joda.time.DateTime;

import java.util.Map;

public class SegmentMetadataEvent implements Event
{
public static final String FEED = "feed";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.druid.java.util.emitter.service;

import com.google.common.collect.ImmutableMap;
import org.joda.time.DateTime;
import org.apache.druid.java.util.common.DateTimes;
import org.junit.Assert;
import org.junit.Test;

Expand All @@ -31,9 +31,9 @@ public void testBasicEvent()
{
SegmentMetadataEvent event = new SegmentMetadataEvent(
"dummy_datasource",
DateTime.parse("2001-01-01T00:00:00.000Z"),
DateTime.parse("2001-01-02T00:00:00.000Z"),
DateTime.parse("2001-01-03T00:00:00.000Z"),
DateTimes.of("2001-01-01T00:00:00.000Z"),
DateTimes.of("2001-01-02T00:00:00.000Z"),
DateTimes.of("2001-01-03T00:00:00.000Z"),
"dummy_version",
true
);
Expand All @@ -42,9 +42,9 @@ public void testBasicEvent()
ImmutableMap.<String, Object>builder()
.put(SegmentMetadataEvent.FEED, "segment_metadata")
.put(SegmentMetadataEvent.DATASOURCE, "dummy_datasource")
.put(SegmentMetadataEvent.CREATED_TIME, DateTime.parse("2001-01-01T00:00:00.000Z"))
.put(SegmentMetadataEvent.START_TIME, DateTime.parse("2001-01-02T00:00:00.000Z"))
.put(SegmentMetadataEvent.END_TIME, DateTime.parse("2001-01-03T00:00:00.000Z"))
.put(SegmentMetadataEvent.CREATED_TIME, DateTimes.of("2001-01-01T00:00:00.000Z"))
.put(SegmentMetadataEvent.START_TIME, DateTimes.of("2001-01-02T00:00:00.000Z"))
.put(SegmentMetadataEvent.END_TIME, DateTimes.of("2001-01-03T00:00:00.000Z"))
.put(SegmentMetadataEvent.VERSION, "dummy_version")
.put(SegmentMetadataEvent.IS_COMPACTED, true)
.build(),
Expand Down
2 changes: 2 additions & 0 deletions extensions-contrib/kafka-emitter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<plugin>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<phase>initialize</phase>
Expand All @@ -138,6 +139,7 @@
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void emit(final Event event)
requestLost.incrementAndGet();
}
} else if (event instanceof SegmentMetadataEvent) {
if (!eventTypes.contains(EventType.SEGMENTMETADATA) ) {
if (!eventTypes.contains(EventType.SEGMENTMETADATA)) {
segmentMetadataLost.incrementAndGet();
} else {
switch (config.getSegmentMetadataTopicFormat()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.kafka.clients.producer.ProducerConfig;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
Expand All @@ -41,7 +40,7 @@ public enum EventType
METRICS,
ALERTS,
REQUESTS,
SEGMENTMETADATA{
SEGMENTMETADATA {
@Override
public String toString()
{
Expand Down

0 comments on commit 3c45762

Please sign in to comment.