scala代码编译不通过
来源:9-9 Checkpoint整合重启策略功能测试screenflow

慕斯743138
2021-08-09
scala代码编译不通过
package com.imooc.scala.stream.checkpoint
import org.apache.flink.api.common.restartstrategy.RestartStrategies
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.streaming.api.windowing.time.Time
import java.util.concurrent.TimeUnit
object CheckpointApp {
def main(args: Array[String]): Unit = {
val env = StreamExecutionEnvironment.getExecutionEnvironment
//开启checkpoint 默认exactly once
env.enableCheckpointing(5000);
env.setRestartStrategy(RestartStrategies.fixedDelayRestart( //这一行编译不通过
3, // number of restart attempts
Time.of(10, TimeUnit.SECONDS) // delay
))
val text = env.socketTextStream("localhost", 9999)
text.print().setParallelism(1)
env.execute("CheckpointApp")
}
}
请问老师是什么原因?
写回答
1回答
-
Michael_PK
2021-08-09
报什么错,
00
相似问题