TRIM_HORIZON与最新 [英] TRIM_HORIZON vs LATEST
问题描述
我在AWS Kinesis
的正式文档中找不到TRIM_HORIZON
和检查点之间的任何显式引用,以及LATEST
和检查点之间的任何引用.
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.
你能证实我的理论吗?
-
TRIM_HORIZON
-如果应用程序名称是新的,那么我将读取流中所有可用的记录.否则,已经使用了应用程序名称,那么我将从 my 的最后一个检查点开始读取.
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
-如果应用程序名称是新的,那么我将读取流中添加了 的流中的所有记录.溪流.否则,已经使用了应用程序名称,我将从最后一个检查点的 我 中读取消息.
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.
TRIM_HORIZON
和LATEST
之间的区别仅在应用程序名称为新名称的情况下.
The difference between TRIM_HORIZON
and LATEST
is only in case the application-name is new.
推荐答案
From GetShardIterator documentation (which lines up with my experience using Kinesis):
在请求中,您可以指定分片迭代器类型
AT_TIMESTAMP
以从任意时间点读取记录,TRIM_HORIZON
导致ShardIterator指向系统中分片中最后未整理的记录(最旧的数据)记录在分片中)或LATEST
,以便您始终读取分片中的最新数据.
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), orLATEST
so that you always read the most recent data in the shard.
基本上,区别在于您是要从最早的记录(TRIM_HORIZON
)还是从现在"开始(LATEST
-在最新检查点与现在之间跳过数据)开始.
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).
这篇关于TRIM_HORIZON与最新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!