Advertisement

【flink】快速打包服务器运行demo

阅读量:

将scala编写的flink程序迅速部署至服务器端,可通过执行bin/flink run -m yarn-cluster xxx.jar命令实现程序的运行。

wordcount 代码

复制代码
    import org.apache.flink.runtime.state.filesystem.FsStateBackend
    import org.apache.flink.streaming.api.{CheckpointingMode, TimeCharacteristic}
    import org.apache.flink.streaming.api.environment.CheckpointConfig.ExternalizedCheckpointCleanup
    import org.apache.flink.streaming.api.scala._
    
    object WordCount {
    
      case class Chengji(id: String, score: Int, ts: Long)
    
      def main(args: Array[String]): Unit = {
    // 创建一个env
    val env = StreamExecutionEnvironmen

全部评论 (0)

还没有任何评论哟~