zoukankan      html  css  js  c++  java
  • Flink学习笔记——scala shell

    Flink也和和spark-shell类似的交互式开发模式

    bin/start-scala-shell.sh yarn
    Starting Flink Shell:
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.address, localhost
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.port, 6123
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.heap.size, 1024m
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.memory.process.size, 1568m
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.numberOfTaskSlots, 1
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: parallelism.default, 1
    20/03/14 14:34:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.execution.failover-strategy, region
    20/03/14 14:34:07 INFO cli.FlinkYarnSessionCli: Found Yarn properties file under /tmp/.yarn-properties-lintong.
    20/03/14 14:34:07 WARN cli.FlinkYarnSessionCli: The configuration directory ('/home/lintong/software/apache/flink-1.10.0/conf') already contains a LOG4J config file.If you want to use logback, then please delete or rename the log configuration file.
    
    Connecting to Flink cluster (host: localhost, port: 6123).
    
    
                             ▒▓██▓██▒
                         ▓████▒▒█▓▒▓███▓▒
                      ▓███▓░░        ▒▒▒▓██▒  ▒
                    ░██▒   ▒▒▓▓█▓▓▒░      ▒████
                    ██▒         ░▒▓███▒    ▒█▒█▒
                      ░▓█            ███   ▓░▒██
                        ▓█       ▒▒▒▒▒▓██▓░▒░▓▓█
                      █░ █   ▒▒░       ███▓▓█ ▒█▒▒▒
                      ████░   ▒▓█▓      ██▒▒▒ ▓███▒
                   ░▒█▓▓██       ▓█▒    ▓█▒▓██▓ ░█░
             ▓░▒▓████▒ ██         ▒█    █▓░▒█▒░▒█▒
            ███▓░██▓  ▓█           █   █▓ ▒▓█▓▓█▒
          ░██▓  ░█░            █  █▒ ▒█████▓▒ ██▓░▒
         ███░ ░ █░          ▓ ░█ █████▒░░    ░█░▓  ▓░
        ██▓█ ▒▒▓▒          ▓███████▓░       ▒█▒ ▒▓ ▓██▓
     ▒██▓ ▓█ █▓█       ░▒█████▓▓▒░         ██▒▒  █ ▒  ▓█▒
     ▓█▓  ▓█ ██▓ ░▓▓▓▓▓▓▓▒              ▒██▓           ░█▒
     ▓█    █ ▓███▓▒░              ░▓▓▓███▓          ░▒░ ▓█
     ██▓    ██▒    ░▒▓▓███▓▓▓▓▓██████▓▒            ▓███  █
    ▓███▒ ███   ░▓▓▒░░   ░▓████▓░                  ░▒▓▒  █▓
    █▓▒▒▓▓██  ░▒▒░░░▒▒▒▒▓██▓░                            █▓
    ██ ▓░▒█   ▓▓▓▓▒░░  ▒█▓       ▒▓▓██▓    ▓▒          ▒▒▓
    ▓█▓ ▓▒█  █▓░  ░▒▓▓██▒            ░▓█▒   ▒▒▒░▒▒▓█████▒
     ██░ ▓█▒█▒  ▒▓▓▒  ▓█                █░      ░░░░   ░█▒
     ▓█   ▒█▓   ░     █░                ▒█              █▓
      █▓   ██         █░                 ▓▓        ▒█▓▓▓▒█░
       █▓ ░▓██░       ▓▒                  ▓█▓▒░░░▒▓█░    ▒█
        ██   ▓█▓░      ▒                    ░▒█▒██▒      ▓▓
         ▓█▒   ▒█▓▒░                         ▒▒ █▒█▓▒▒░░▒██
          ░██▒    ▒▓▓▒                     ▓██▓▒█▒ ░▓▓▓▓▒█▓
            ░▓██▒                          ▓░  ▒█▓█  ░░▒▒▒
                ▒▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▓▓  ▓░▒█░
    
                  F L I N K - S C A L A - S H E L L
    

    读文件

    scala> val dataSet = benv.readTextFile("hdfs://master:8020/user/lintong/logs/test/test.log")
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.address, localhost
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.rpc.port, 6123
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.heap.size, 1024m
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.memory.process.size, 1568m
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: taskmanager.numberOfTaskSlots, 1
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: parallelism.default, 1
    20/03/14 14:49:07 INFO configuration.GlobalConfiguration: Loading configuration property: jobmanager.execution.failover-strategy, region
    dataSet: org.apache.flink.api.scala.DataSet[String] = org.apache.flink.api.scala.DataSet@13e5b262
    

    打印

    scala> dataSet.print()
    20/03/14 14:49:10 INFO java.ExecutionEnvironment: The job has 0 registered types and 0 default Kryo serializers
    20/03/14 14:49:11 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    20/03/14 14:49:11 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.2.105:8032
    20/03/14 14:49:11 INFO yarn.YarnClusterDescriptor: No path for the flink jar passed. Using the location of class org.apache.flink.yarn.YarnClusterDescriptor to locate the jar
    20/03/14 14:49:11 INFO yarn.YarnClusterDescriptor: Found Web Interface master:36441 of application 'application_1584163852090_0002'.
    1
    2
    3
    4
    
  • 相关阅读:
    asp.net mvc上传头像加剪裁功能
    CSS基础部分总结
    Web前端之初学CSS
    JavaScript中的new操作符的原理解析
    JS常用数组API汇总
    【NOIP2020提高B组模拟11.26】卡常题
    【NOIP2020提高B组模拟11.26】逗气
    CSP-J/S总结
    计数题
    浅谈线段树——基础篇
  • 原文地址:https://www.cnblogs.com/tonglin0325/p/12492176.html
Copyright © 2011-2022 走看看