Struct dataflow::source::KinesisSourceReader [−][src]
pub struct KinesisSourceReader {
kinesis_client: KinesisClient,
stream_name: String,
shard_set: HashMap<String, ShardMetrics>,
shard_queue: VecDeque<(String, Option<String>)>,
last_checked_shards: Instant,
buffered_messages: VecDeque<SourceMessage<Option<Vec<u8>>, Option<Vec<u8>>>>,
processed_message_count: i64,
base_metrics: KinesisMetrics,
}
Expand description
Contains all information necessary to ingest data from Kinesis
Fields
kinesis_client: KinesisClient
Kinesis client used to obtain records
stream_name: String
The name of the stream
shard_set: HashMap<String, ShardMetrics>
The set of active shards
shard_queue: VecDeque<(String, Option<String>)>
A queue representing the next shard to read from. This is necessary to ensure that all shards are read from uniformly
last_checked_shards: Instant
The time at which we last refreshed metadata TODO(natacha): this should be moved to timestamper
buffered_messages: VecDeque<SourceMessage<Option<Vec<u8>>, Option<Vec<u8>>>>
Storage for messages that have not yet been timestamped
processed_message_count: i64
Count of processed message
base_metrics: KinesisMetrics
Metrics from which per-shard metrics get created.
Implementations
async fn get_records(
&self,
shard_iterator: &str
) -> Result<GetRecordsOutput, SdkError<GetRecordsError>>
async fn get_records(
&self,
shard_iterator: &str
) -> Result<GetRecordsOutput, SdkError<GetRecordsError>>
Obtains the next record for this shard given a shard iterator
Trait Implementations
fn new(
_source_name: String,
_source_id: SourceInstanceId,
_worker_id: usize,
_worker_count: usize,
_consumer_activator: SyncActivator,
connector: ExternalSourceConnector,
_restored_offsets: Vec<(PartitionId, Option<MzOffset>)>,
_encoding: SourceDataEncoding,
_: Option<Logger>,
base_metrics: SourceBaseMetrics
) -> Result<(Self, Option<PartitionId>), Error>
fn new(
_source_name: String,
_source_id: SourceInstanceId,
_worker_id: usize,
_worker_count: usize,
_consumer_activator: SyncActivator,
connector: ExternalSourceConnector,
_restored_offsets: Vec<(PartitionId, Option<MzOffset>)>,
_encoding: SourceDataEncoding,
_: Option<Logger>,
base_metrics: SourceBaseMetrics
) -> Result<(Self, Option<PartitionId>), Error>
Create a new source reader. Read more
Returns the next message available from the source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for KinesisSourceReader
impl Send for KinesisSourceReader
impl Sync for KinesisSourceReader
impl Unpin for KinesisSourceReader
impl !UnwindSafe for KinesisSourceReader
Blanket Implementations
Mutably borrows from an owned value. Read more
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