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, wait
Methods 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:Record
Retrieves the actual data of the record. -
getTopicName
Description copied from interface:Record
If the record originated from a topic, report the topic name.- Specified by:
getTopicName
in interfaceRecord<T>
-
getDestinationTopic
Description copied from interface:Record
To support message routing on a per message basis.- Specified by:
getDestinationTopic
in interfaceRecord<T>
- Returns:
- The topic this message should be written to
-
getProperties
Description copied from interface:Record
Retrieves user-defined properties attached to record.- Specified by:
getProperties
in interfaceRecord<T>
- Returns:
- Map of user-properties
-
getKey
Description copied from interface:Record
Return a key if the key has one associated. -
getSchema
-
getEventTime
Description copied from interface:Record
Retrieves the event time of the record from the source.- Specified by:
getEventTime
in interfaceRecord<T>
- Returns:
- millis since epoch
-
getPartitionId
Description copied from interface:Record
Retrieves the partition information if any of the record.- Specified by:
getPartitionId
in interfaceRecord<T>
- Returns:
- The partition id where the
-
getPartitionIndex
Description copied from interface:Record
Retrieves the partition index if any of the record.- Specified by:
getPartitionIndex
in interfaceRecord<T>
- Returns:
- The partition index
-
getRecordSequence
Description copied from interface:Record
Retrieves the sequence of the record from a source partition.- Specified by:
getRecordSequence
in interfaceRecord<T>
- Returns:
- Sequence Id associated with the record
-