Package org.apache.beam.sdk.io.kafka
Interface KafkaPublishTimestampFunction<T>
-
- All Superinterfaces:
java.io.Serializable
public interface KafkaPublishTimestampFunction<T> extends java.io.SerializableAn interface for providing custom timestamp for elements written to Kafka.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description org.joda.time.InstantgetTimestamp(T element, org.joda.time.Instant elementTimestamp)Returns timestamp for element being published to Kafka.static <T> KafkaPublishTimestampFunction<T>withElementTimestamp()ReturnsKafkaPublishTimestampFunctionreturns element timestamp from ProcessContext.
-
-
-
Method Detail
-
getTimestamp
org.joda.time.Instant getTimestamp(T element, org.joda.time.Instant elementTimestamp)
Returns timestamp for element being published to Kafka. See @ProducerRecord.- Parameters:
element- The element being published.elementTimestamp- Timestamp of the element from the context (i.e. @DoFn.ProcessContext.timestamp()
-
withElementTimestamp
static <T> KafkaPublishTimestampFunction<T> withElementTimestamp()
ReturnsKafkaPublishTimestampFunctionreturns element timestamp from ProcessContext.
-
-