接口 Record<T>
-
- 所有已知子接口:
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.
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default voidack()Acknowledge that this record is fully processed.default voidfail()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.TgetValue()Retrieves the actual data of the record.
-
-
-
方法详细资料
-
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.- 返回:
- The record data
-
getEventTime
default java.util.Optional<java.lang.Long> getEventTime()
Retrieves the event time of the record from the source.- 返回:
- millis since epoch
-
getPartitionId
default java.util.Optional<java.lang.String> getPartitionId()
Retrieves the partition information if any of the record.- 返回:
- The partition id where the
-
getPartitionIndex
default java.util.Optional<java.lang.Integer> getPartitionIndex()
Retrieves the partition index if any of the record.- 返回:
- The partition index
-
getRecordSequence
default java.util.Optional<java.lang.Long> getRecordSequence()
Retrieves the sequence of the record from a source partition.- 返回:
- 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.- 返回:
- 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.- 返回:
- The topic this message should be written to
-
getMessage
default java.util.Optional<org.apache.pulsar.client.api.Message<T>> getMessage()
-
-