RecordAndMetadata Class

On This Page
Fully Qualified Name

org.apache.spark.streaming.v3io.RecordAndMetadata

Description

A case class that represents a platform stream record. The class exposes methods for extracting decoded record data and related metadata.

Summary

Instance Constructors

case class RecordAndMetadata[V](
    topic:            String,
    partitionId:      Short,
    private val rec:  ConsumerRecord,
    valueDecoder:     Decoder[V])
    extends Encoding with Logging
Methods

Instance Constructors

Syntax

RecordAndMetadata[V](
    topic:            String,
    partitionId:      Short,
    private val rec:  ConsumerRecord,
    valueDecoder:     Decoder[V])

Parameters and Data Members

topic
The name of the stream that contains the record.

  • Type: String
  • Requirement: Required
partitionId
The ID of the stream shard that contains the record (see Stream Sharding and Partitioning).

  • Type: Short
  • Requirement: Required
valueDecoder

A decoder instance for converting the record’s data into the desired type — the value type of the current class instance (see the V type parameter).

  • Requirement: Required

Type Parameters

  • V — the data type into which to convert the record data (“value”).

payload Method

Returns decoded record data (“payload”), in the specified format.

Syntax

payload(): V

Parameters

None

Return Value

Returns the decoded record data, formatted as the value type of the current class instance (see the constructor’s V type parameter).

payloadWithMetadata Method

Returns decoded record data (“payload”), in the specified format, and related metadata.

Syntax

payloadWithMetadata(): PayloadWithMetadata[V]

Parameters

None

Return Value

Returns a PayloadWithMetadata object that contains the decoded record data and related metadata.