类 FunctionRecord<T>

java.lang.Object
org.apache.pulsar.functions.api.utils.FunctionRecord<T>
所有已实现的接口:
Record<T>

public class FunctionRecord<T> extends Object implements Record<T>
  • 构造器详细资料

    • FunctionRecord

      public FunctionRecord()
  • 方法详细资料

    • from

      public static <T> FunctionRecord.FunctionRecordBuilder<T> from(Context context, Schema<T> schema)
      Creates a builder for a Record from a Function Context. The builder is initialized with the output topic from the Context and with the topicName, key, eventTime, properties, partitionId, partitionIndex and recordSequence from the Context input Record. It doesn't initialize a Message at the moment.
      类型参数:
      T - type of Record to build
      参数:
      context - a Function Context
      返回:
      a Record builder initialised with values from the Function Context
    • getValue

      public T getValue()
      从接口复制的说明: Record
      Retrieves the actual data of the record.
      指定者:
      getValue 在接口中 Record<T>
      返回:
      The record data
    • getTopicName

      public Optional<String> getTopicName()
      从接口复制的说明: Record
      If the record originated from a topic, report the topic name.
      指定者:
      getTopicName 在接口中 Record<T>
    • getDestinationTopic

      public Optional<String> getDestinationTopic()
      从接口复制的说明: Record
      To support message routing on a per message basis.
      指定者:
      getDestinationTopic 在接口中 Record<T>
      返回:
      The topic this message should be written to
    • getProperties

      public Map<String,String> getProperties()
      从接口复制的说明: Record
      Retrieves user-defined properties attached to record.
      指定者:
      getProperties 在接口中 Record<T>
      返回:
      Map of user-properties
    • getKey

      public Optional<String> getKey()
      从接口复制的说明: Record
      Return a key if the key has one associated.
      指定者:
      getKey 在接口中 Record<T>
    • getSchema

      public Schema<T> getSchema()
      指定者:
      getSchema 在接口中 Record<T>
    • getEventTime

      public Optional<Long> getEventTime()
      从接口复制的说明: Record
      Retrieves the event time of the record from the source.
      指定者:
      getEventTime 在接口中 Record<T>
      返回:
      millis since epoch
    • getPartitionId

      public Optional<String> getPartitionId()
      从接口复制的说明: Record
      Retrieves the partition information if any of the record.
      指定者:
      getPartitionId 在接口中 Record<T>
      返回:
      The partition id where the
    • getPartitionIndex

      public Optional<Integer> getPartitionIndex()
      从接口复制的说明: Record
      Retrieves the partition index if any of the record.
      指定者:
      getPartitionIndex 在接口中 Record<T>
      返回:
      The partition index
    • getRecordSequence

      public Optional<Long> getRecordSequence()
      从接口复制的说明: Record
      Retrieves the sequence of the record from a source partition.
      指定者:
      getRecordSequence 在接口中 Record<T>
      返回:
      Sequence Id associated with the record