首页 > 其他 > 详细

Flink学习笔记——scala sell

时间:2020-03-14 15:30:11      阅读:235      评论:0      收藏:0      [点我收藏+]

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

 

Flink学习笔记——scala sell

原文:https://www.cnblogs.com/tonglin0325/p/12492176.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!