apache-flink - 检测到“execution.runtime-mode”设置为“BATCH”的 UNBOUNDED 源
问题描述
我有以下简单的测试用例。
test("batch query test 4") {
val env = StreamExecutionEnvironment.getExecutionEnvironment
env.setParallelism(1)
env.setRuntimeMode(RuntimeExecutionMode.BATCH)
//Detected an UNBOUNDED source with the 'execution.runtime-mode' set to 'BATCH'.
// This combination is not allowed, please set the 'execution.runtime-mode' to STREAMING or AUTOMATIC
val ds = env.addSource(new StockSource(emitInterval = 1500))
ds.print()
env.execute()
}
这StockSource
是一个简单的实现SourceFunction
,当我运行上面的应用程序时,抛出一个异常,异常消息如下,我会问
- 这是否意味着所有的实现都
SourceFunction
将被视为无界? - 就我而言,我怎样才能使该
addSource
方法起作用,我的代码中是否遗漏了一些东西。
解决方案
推荐阅读
- javascript - 与 ARRAYFORMULA 一起使用的自定义表格功能
- python - 如何生成与父进程具有相同参数的 Python 多进程?
- azure-functions - Azure Functions 消耗计划和冷启动成本
- mysql - 在每列都必须支持排序的排行榜表中存储数据的最佳方式是什么?
- r - 添加具有独特颜色和大小的自定义轴标签
- html - CSS -webkit-box-shadow 在 Microsoft Edge 中不起作用
- json - 如何在 PowerShell 中解析嵌套的 JSON?
- keycloak - Keycloak startTLS openldap 用户凭据失败
- mongodb - 尝试将集群连接到应用程序
- python - 在实现胶囊网络时,由于通道数的变化,我遇到了运行时错误