pub trait PartitionExt<T: ArconType> {
// Required method
fn key_by<KEY: Hash + 'static, F: Fn(&T) -> &KEY + ArconFnBounds>(
self,
key_extractor: F,
) -> KeyedStream<T>;
}Expand description
Extension trait for partitioning schemes
Required Methods§
Sourcefn key_by<KEY: Hash + 'static, F: Fn(&T) -> &KEY + ArconFnBounds>(
self,
key_extractor: F,
) -> KeyedStream<T>
fn key_by<KEY: Hash + 'static, F: Fn(&T) -> &KEY + ArconFnBounds>( self, key_extractor: F, ) -> KeyedStream<T>
Consistently partition the Stream using the given key extractor method.
The key extractor function must be deterministic, for two identical events it must return the same key whenever it is called.
Example
use arcon::prelude::*;
let stream: KeyedStream<u64> = (0..100)
.to_stream(|conf| {
conf.set_arcon_time(ArconTime::Process);
})
.key_by(|i: &u64| i);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.