简体   繁体   中英

Kinesis shard iterator explanation

I'm trying to get records from a Kinesis shard. I loop through getting shard iterators, then getting the records within the iterator. I seem to get an endless number of iterators, none containing any records.

My question involves the life span of iterators. Given that Kinesis is only holding data for 24 hours and iterators are supposed to have a 5 minute lifespan, shouldn't I only see a maximum of 288 iterators at any point in time?

There aren't a set number of shard iterators , because shard iterators are just unique positions in a given shard , of a given record .

A shard iterator is just a sequence number of a given record at some point in a shard.

As per the documentation here :

A sequence number is the identifier associated with every record ingested in the stream, and is assigned when a record is put into the stream. Each stream has one or more shards

A shard iterator specifies the shard position from which to start reading data records sequentially.

So from the above I believe a shard iterator is literally an arbitrary ID, based on a timestamp.

The position is specified using the sequence number of a data record in a shard.

So the number of iterators is actually more closely related to the number of records in a given shard.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM