TRIM_HORIZON与最新 [英] TRIM_HORIZON vs LATEST

查看:118
本文介绍了TRIM_HORIZON与最新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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_HORIZONLATEST之间的区别仅在应用程序名称为新名称的情况下.

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), or LATEST 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆