Skip to content

Commit

Permalink
Add timestamp field to SegmentMetadataEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
maytasm committed Jun 15, 2024
1 parent aec1d5d commit 07e23b3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.druid.java.util.emitter.service;

import com.fasterxml.jackson.annotation.JsonValue;
import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.emitter.core.Event;
import org.apache.druid.java.util.emitter.core.EventMap;
import org.apache.druid.timeline.DataSegment;
Expand Down Expand Up @@ -85,7 +86,7 @@ public SegmentMetadataEvent(
)
{
this.dataSource = dataSource;
this.createdTime = createdTime;
this.createdTime = createdTime != null ? createdTime : DateTimes.nowUtc();
this.startTime = startTime;
this.endTime = endTime;
this.version = version;
Expand All @@ -104,6 +105,7 @@ public EventMap toMap()

return EventMap.builder()
.put(FEED, getFeed())
.put("timestamp", createdTime.toString())
.put(DATASOURCE, dataSource)
.put(CREATED_TIME, createdTime)
.put(START_TIME, startTime)
Expand Down

0 comments on commit 07e23b3

Please sign in to comment.