TRIM_HORIZON vs LATEST

♀尐吖头ヾ 提交于 2019-11-30 14:57:06

问题


I can't find in the formal documentation of AWS Kinesis any explicit reference between TRIM_HORIZON and the checkpoint, and also any reference between LATEST and the checkpoint.

Can you confirm my theory:

  • TRIM_HORIZON - In case the application-name is new, then I will read all the records available in the stream. Else, application-name was already used, then I will read from my last checkpoint.

  • LATEST - In case the application-name is new, then I will read all the records in the stream which added after I subscribed to the stream. Else, application-name was already used, I will read messages from my last checkpoint.

  • The difference between TRIM_HORIZON and LATEST is only in case the application-name is new.


回答1:


From GetShardIterator documentation (which lines up with my experience using Kinesis):

In the request, you can specify the shard iterator type AT_TIMESTAMP to read records from an arbitrary point in time, TRIM_HORIZON to cause ShardIterator to point to the last untrimmed record in the shard in the system (the oldest data record in the shard), or LATEST so that you always read the most recent data in the shard.

Basically, the difference is whether you want to start from the oldest record (TRIM_HORIZON), or from "right now" (LATEST - skipping data between latest checkpoint and now).




回答2:


AT_TIMESTAMP

-- from specific time stamp

TRIM_HORIZON

-- all the available messages in Kinesis stream (same as earliest in Kafka)

LATEST

-- from the latest messages



来源:https://stackoverflow.com/questions/49728807/trim-horizon-vs-latest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!