Struct dataflow::source::SourceOutput[][src]

pub struct SourceOutput<K, V> where
    K: Data,
    V: Data
{ pub key: K, pub value: V, pub position: Option<i64>, pub upstream_time_millis: Option<i64>, pub partition: PartitionId, }
Expand description

A record produced by a source

Fields

key: K

The record’s key (or some empty/default value for sources without the concept of key)

value: V

The record’s value

position: Option<i64>

The position in the source, if such a concept exists (e.g., Kafka offset, file line number)

upstream_time_millis: Option<i64>

The time the record was created in the upstream systsem, as milliseconds since the epoch

partition: PartitionId

The partition of this message, present iff the partition comes from Kafka

Implementations

Build a new SourceOutput

A parallelization contract that hashes by keys.

It would not be ideal to use this in a case where the keys might be empty (or for any other reason too often the same), as that would lead to serial execution of whatever operator is being “parallelized” by this contract.

One good reason to use this (and as of this writing, apparently the only reason) is for operators that need to do some dedpulication logic based on keys: For example, upserts, or Debezium dedpulication based on MySQL binlog coordinates.

A parallelization contract that hashes by positions (if available) and otherwise falls back to hashing by value. Values can be just as skewed as keys, whereas positions are generally known to be unique or close to unique in a source. For example, Kafka offsets are unique per-partition. Most decode logic should use this instead of key_contract.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Upcasts this ProgressEventTimestamp to Any. Read more

Returns the name of the concrete type of this object. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more