Class FunctionRecord<T>
java.lang.Object
org.apache.pulsar.functions.api.utils.FunctionRecord<T>
- All Implemented Interfaces:
Record<T>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> FunctionRecord.FunctionRecordBuilder<T> Creates a builder for a Record from a Function Context.To support message routing on a per message basis.Retrieves the event time of the record from the source.getKey()Return a key if the key has one associated.Retrieves the partition information if any of the record.Retrieves the partition index if any of the record.Retrieves user-defined properties attached to record.Retrieves the sequence of the record from a source partition.org.apache.pulsar.client.api.Schema<T> If the record originated from a topic, report the topic name.getValue()Retrieves the actual data of the record.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.functions.api.Record
ack, fail, getMessage
-
Constructor Details
-
FunctionRecord
public FunctionRecord()
-
-
Method Details
-
from
public static <T> FunctionRecord.FunctionRecordBuilder<T> from(Context context, org.apache.pulsar.client.api.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.- Type Parameters:
T- type of Record to build- Parameters:
context- a Function Context- Returns:
- a Record builder initialised with values from the Function Context
-
getValue
Description copied from interface:RecordRetrieves the actual data of the record. -
getTopicName
Description copied from interface:RecordIf the record originated from a topic, report the topic name.- Specified by:
getTopicNamein interfaceRecord<T>
-
getDestinationTopic
Description copied from interface:RecordTo support message routing on a per message basis.- Specified by:
getDestinationTopicin interfaceRecord<T>- Returns:
- The topic this message should be written to
-
getProperties
Description copied from interface:RecordRetrieves user-defined properties attached to record.- Specified by:
getPropertiesin interfaceRecord<T>- Returns:
- Map of user-properties
-
getKey
Description copied from interface:RecordReturn a key if the key has one associated. -
getSchema
-
getEventTime
Description copied from interface:RecordRetrieves the event time of the record from the source.- Specified by:
getEventTimein interfaceRecord<T>- Returns:
- millis since epoch
-
getPartitionId
Description copied from interface:RecordRetrieves the partition information if any of the record.- Specified by:
getPartitionIdin interfaceRecord<T>- Returns:
- The partition id where the
-
getPartitionIndex
Description copied from interface:RecordRetrieves the partition index if any of the record.- Specified by:
getPartitionIndexin interfaceRecord<T>- Returns:
- The partition index
-
getRecordSequence
Description copied from interface:RecordRetrieves the sequence of the record from a source partition.- Specified by:
getRecordSequencein interfaceRecord<T>- Returns:
- Sequence Id associated with the record
-