wuchong commented on a change in pull request #9415: [FLINK-12939][docs-zh] Translate "Apache Kafka Connector" page into C… URL: https://github.com/apache/flink/pull/9415#discussion_r312739219
########## File path: docs/dev/connectors/kafka.zh.md ########## @@ -532,41 +442,28 @@ stream = env </div> </div> -Internally, an instance of the assigner is executed per Kafka partition. -When such an assigner is specified, for each record read from Kafka, the -`extractTimestamp(T element, long previousElementTimestamp)` is called to assign a timestamp to the record and -the `Watermark getCurrentWatermark()` (for periodic) or the -`Watermark checkAndGetNextWatermark(T lastElement, long extractedTimestamp)` (for punctuated) is called to determine -if a new watermark should be emitted and with which timestamp. - -**Note**: If a watermark assigner depends on records read from Kafka to advance its watermarks -(which is commonly the case), all topics and partitions need to have a continuous stream of records. -Otherwise, the watermarks of the whole application cannot advance and all time-based operations, -such as time windows or functions with timers, cannot make progress. A single idle Kafka partition causes this behavior. -A Flink improvement is planned to prevent this from happening -(see [FLINK-5479: Per-partition watermarks in FlinkKafkaConsumer should consider idle partitions]( -https://issues.apache.org/jira/browse/FLINK-5479)). -In the meanwhile, a possible workaround is to send *heartbeat messages* to all consumed partitions that advance the watermarks of idle partitions. +在内部,每个 Kafka 分区执行一个 assigner 实例。当指定了这样的 assigner 时,对于从 Kafka 读取的每条消息,调用 `extractTimestamp(T element, long previousElementTimestamp)` 来为记录分配时间戳,并为 `Watermark getCurrentWatermark()` (定期)或 `Watermark checkAndGetNextWatermark(T lastElement, long extractedTimestamp)` (用于标点符号)以确定是否应该发出新的 watermark 以及使用哪个时间戳。 Review comment: ```suggestion 在内部,每个 Kafka 分区执行一个 assigner 实例。当指定了这样的 assigner 时,对于从 Kafka 读取的每条消息,调用 `extractTimestamp(T element, long previousElementTimestamp)` 来为记录分配时间戳,并为 `Watermark getCurrentWatermark()` (定期形式)或 `Watermark checkAndGetNextWatermark(T lastElement, long extractedTimestamp)` (打点形式)以确定是否应该发出新的 watermark 以及使用哪个时间戳。 ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
