Package org.apache.pulsar.functions.api
Interface Record<T>
-
- All Known Subinterfaces:
KVRecord<K,V>
@Public @Stable public interface Record<T>
Pulsar Connect's Record interface. Record encapsulates the information about a record being read from a Source.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
ack()
Acknowledge that this record is fully processed.default void
fail()
To indicate that this record has failed to be processed.default java.util.Optional<java.lang.String>
getDestinationTopic()
To support message routing on a per message basis.default java.util.Optional<java.lang.Long>
getEventTime()
Retrieves the event time of the record from the source.default java.util.Optional<java.lang.String>
getKey()
Return a key if the key has one associated.default java.util.Optional<org.apache.pulsar.client.api.Message<T>>
getMessage()
default java.util.Optional<java.lang.String>
getPartitionId()
Retrieves the partition information if any of the record.default java.util.Optional<java.lang.Integer>
getPartitionIndex()
Retrieves the partition index if any of the record.default java.util.Map<java.lang.String,java.lang.String>
getProperties()
Retrieves user-defined properties attached to record.default java.util.Optional<java.lang.Long>
getRecordSequence()
Retrieves the sequence of the record from a source partition.default org.apache.pulsar.client.api.Schema<T>
getSchema()
default java.util.Optional<java.lang.String>
getTopicName()
If the record originated from a topic, report the topic name.T
getValue()
Retrieves the actual data of the record.
-
-
-
Method Detail
-
getTopicName
default java.util.Optional<java.lang.String> getTopicName()
If the record originated from a topic, report the topic name.
-
getKey
default java.util.Optional<java.lang.String> getKey()
Return a key if the key has one associated.
-
getSchema
default org.apache.pulsar.client.api.Schema<T> getSchema()
-
getValue
T getValue()
Retrieves the actual data of the record.- Returns:
- The record data
-
getEventTime
default java.util.Optional<java.lang.Long> getEventTime()
Retrieves the event time of the record from the source.- Returns:
- millis since epoch
-
getPartitionId
default java.util.Optional<java.lang.String> getPartitionId()
Retrieves the partition information if any of the record.- Returns:
- The partition id where the
-
getPartitionIndex
default java.util.Optional<java.lang.Integer> getPartitionIndex()
Retrieves the partition index if any of the record.- Returns:
- The partition index
-
getRecordSequence
default java.util.Optional<java.lang.Long> getRecordSequence()
Retrieves the sequence of the record from a source partition.- Returns:
- Sequence Id associated with the record
-
getProperties
default java.util.Map<java.lang.String,java.lang.String> getProperties()
Retrieves user-defined properties attached to record.- Returns:
- Map of user-properties
-
ack
default void ack()
Acknowledge that this record is fully processed.
-
fail
default void fail()
To indicate that this record has failed to be processed.
-
getDestinationTopic
default java.util.Optional<java.lang.String> getDestinationTopic()
To support message routing on a per message basis.- Returns:
- The topic this message should be written to
-
getMessage
default java.util.Optional<org.apache.pulsar.client.api.Message<T>> getMessage()
-
-