Struct mz_storage::source::SourceOutput
source · [−]pub struct SourceOutput<K, V, D> where
K: Data,
V: Data, {
pub key: K,
pub value: V,
pub position: MzOffset,
pub upstream_time_millis: Option<i64>,
pub partition: PartitionId,
pub headers: Option<Vec<(String, Option<Vec<u8>>)>>,
pub diff: D,
}
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: MzOffset
The position in the partition described by the partition
in the source
(e.g., Kafka offset, file line number, monotonic increasing
number, etc.)
upstream_time_millis: Option<i64>
The time the record was created in the upstream system, as milliseconds since the epoch
partition: PartitionId
The partition of this message, present iff the partition comes from Kafka
headers: Option<Vec<(String, Option<Vec<u8>>)>>
Headers, if the source is configured to pass them along. If it is, but there are none, it
passes Some([])
diff: D
Indicator for what the differential diff
value
for this decoded message should be
Implementations
sourceimpl<K, V, D> SourceOutput<K, V, D> where
K: Data,
V: Data,
impl<K, V, D> SourceOutput<K, V, D> where
K: Data,
V: Data,
sourceimpl<K, V, D> SourceOutput<K, V, D> where
K: Data + Serialize + for<'a> Deserialize<'a> + Send + Sync,
V: Data + Serialize + for<'a> Deserialize<'a> + Send + Sync,
D: Data + Serialize + for<'a> Deserialize<'a> + Send + Sync,
impl<K, V, D> SourceOutput<K, V, D> where
K: Data + Serialize + for<'a> Deserialize<'a> + Send + Sync,
V: Data + Serialize + for<'a> Deserialize<'a> + Send + Sync,
D: Data + Serialize + for<'a> Deserialize<'a> + Send + Sync,
sourcepub fn position_value_contract(
) -> impl ParallelizationContract<Timestamp, Self> where
V: Hashable<Output = u64>,
pub fn position_value_contract(
) -> impl ParallelizationContract<Timestamp, Self> where
V: Hashable<Output = u64>,
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
sourceimpl<K: Clone, V: Clone, D: Clone> Clone for SourceOutput<K, V, D> where
K: Data,
V: Data,
impl<K: Clone, V: Clone, D: Clone> Clone for SourceOutput<K, V, D> where
K: Data,
V: Data,
sourcefn clone(&self) -> SourceOutput<K, V, D>
fn clone(&self) -> SourceOutput<K, V, D>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'de, K, V, D> Deserialize<'de> for SourceOutput<K, V, D> where
K: Data,
V: Data,
K: Deserialize<'de>,
V: Deserialize<'de>,
D: Deserialize<'de>,
impl<'de, K, V, D> Deserialize<'de> for SourceOutput<K, V, D> where
K: Data,
V: Data,
K: Deserialize<'de>,
V: Deserialize<'de>,
D: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<K, V, D> RefUnwindSafe for SourceOutput<K, V, D> where
D: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, D> Send for SourceOutput<K, V, D> where
D: Send,
K: Send,
V: Send,
impl<K, V, D> Sync for SourceOutput<K, V, D> where
D: Sync,
K: Sync,
V: Sync,
impl<K, V, D> Unpin for SourceOutput<K, V, D> where
D: Unpin,
K: Unpin,
V: Unpin,
impl<K, V, D> UnwindSafe for SourceOutput<K, V, D> where
D: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ProgressEventTimestamp for T where
T: Data + Debug + Any,
impl<T> ProgressEventTimestamp for T where
T: Data + Debug + Any,
sourceimpl<P, R> ProtoType<R> for P where
R: RustType<P>,
impl<P, R> ProtoType<R> for P where
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See RustType::from_proto
.
sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See RustType::into_proto
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more