简单的wordcount程序,当设置了
env.setStateBackend(new RocksDBStateBackend(checkpointPath, true));
就会报
Caused by: java.lang.IllegalArgumentException: The fraction of memory to
allocate should not be 0. Please make sure that all types of managed memory
consumers contained in the job are configured with a non-negative weight via
`taskmanager.memory.managed.consumer-weights`.
查看源码是在
StreamConfig的
getManagedMemoryFractionOperatorUseCaseOfSlot 方法内,得到的是0.0
因为getAllManagedMemoryUseCases 返回的是0导致的。
因为config不存在一个key : managedMemFraction.STATE_BACKEND
当我手动添加这个key就可以正常执行了。
执行代码如下:
https://paste.ubuntu.com/p/9WrBz3Xrc6/--
Sent from:
http://apache-flink.147419.n8.nabble.com/