闪烁:键组91不属于本地范围



作为标题,异常发生在键控窗口中,

java.lang.IllegalArgumentException: Key Group 91 does not belong to the local range.
at org.apache.flink.util.Preconditions.checkArgument(Preconditions.java:139)
at org.apache.flink.streaming.api.operators.HeapInternalTimerService.getIndexForKeyGroup(HeapInternalTimerService.java:431)
at org.apache.flink.streaming.api.operators.HeapInternalTimerService.getProcessingTimeTimerSetForKeyGroup(HeapInternalTimerService.java:412)
at org.apache.flink.streaming.api.operators.HeapInternalTimerService.getProcessingTimeTimerSetForTimer(HeapInternalTimerService.java:402)
at org.apache.flink.streaming.api.operators.HeapInternalTimerService.registerProcessingTimeTimer(HeapInternalTimerService.java:194)
at org.apache.flink.streaming.runtime.operators.windowing.WindowOperator$Context.registerProcessingTimeTimer(WindowOperator.java:907)
at org.apache.flink.streaming.api.windowing.triggers.ProcessingTimeTrigger.onElement(ProcessingTimeTrigger.java:36)
at org.apache.flink.streaming.api.windowing.triggers.ProcessingTimeTrigger.onElement(ProcessingTimeTrigger.java:28)
at org.apache.flink.streaming.runtime.operators.windowing.WindowOperator$Context.onElement(WindowOperator.java:926)
at org.apache.flink.streaming.runtime.operators.windowing.WindowOperator.processElement(WindowOperator.java:393)
at org.apache.flink.streaming.runtime.io.StreamInputProcessor.processInput(StreamInputProcessor.java:207)
at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.run(OneInputStreamTask.java:69)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:264)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
at java.lang.Thread.run(Thread.java:745)

代码为:

stream.keyBy(...).timeWindow(Time.minutes(5)).apply(...)

keyBy的实现是String结果。有什么想法吗?我在HeapInternalTimerService中看到过代码,但keyGroupId超出本地范围是什么情况?

我看到了两种可能导致此错误的可能性。

  1. 您的密钥提取器函数是不确定的,即它可能返回不同的值
  2. Flink中有一个bug

请检查1。事实并非如此。如果您确信密钥提取器不是问题所在,请联系Flink用户邮件列表或创建Jira问题。

相关内容

  • 没有找到相关文章

最新更新