Git Product home page Git Product logo

hello-flink's Introduction

Hello-Flink

基于Apache Flink 1.9 使用BlinkPlanner学习Flink的使用。

Flink是什么

Apache Flink 是一个分布式流批一体化的开源平台。Flink 的核心是一个提供数据分发、通信以及自动容错的流计算引擎。Flink 在流计算之上构建批处理,并且原生的支持迭代计算,内存管理以及程序优化。

项目构建

  • 构建maven项目

    mvn archetype:generate                               \
          -DarchetypeGroupId=org.apache.flink              \
          -DarchetypeArtifactId=flink-quickstart-java      \
          -DarchetypeVersion=1.9.0
    

    它将以交互式的方式询问你项目的 groupId、artifactId 和 package 名称。

    pom.xml 中有些Flink的依赖作用范围是provided,在本地运行时需要选中add-dependencies-for-IDEA这个profile,集群环境打包时取消选中该profile,因为集群环境中已经存在该些jar。

  • pom.xml 依赖信息

    基础功能依赖上面构建中的依赖即可。

    使用 Table Api & Sql 时 需要加入下面的依赖。

    <dependency>
         <groupId>org.apache.flink</groupId>
         <artifactId>flink-table-planner-blink_2.11</artifactId>
         <version>${flink.version}</version>
     </dependency>
    

    从不同的输入输出源中读写数据需要加入相应的依赖。

  • 编写Flink程序的基本步骤如下:

    1. 获取运行环境(execution environment)
    2. 加载/创建初始数据
    3. 对数据进行转换处理
    4. 指定处理后数据的输出位置
    5. 触发程序的运行

基础入门-输入输出篇

在基础入门篇中先不介绍Flink的集群环境,直接在Ide中运行Flink程序代码(程序在启动时会启动一个多线程本地环境),对于集群环境来说代码不需要做任何修改只需提交到集群环境中运行即可。

在该输入输出篇中分别以Datastream API 和 Table API & SQL的方式介绍几种常用的输入输出:

基础入门-数据处理篇 todo

数据处理的基本流程是对输入数据经过一系列的处理后落地到输出中。输入输出篇中主要介绍了数据的读取和写入相关知识。在数据处理篇中主要讲解在Flink中如何处理分布式数据。

hello-flink's People

Contributors

apengda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.