真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Flink中如何搭建開(kāi)發(fā)環(huán)境與數(shù)據(jù)

這篇文章將為大家詳細(xì)講解有關(guān)Flink中如何搭建開(kāi)發(fā)環(huán)境與數(shù)據(jù),文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

松桃ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)建站的ssl證書(shū)銷(xiāo)售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書(shū)合作)期待與您的合作!

 示例環(huán)境

java.version: 1.8.x
flink.version: 1.11.1

創(chuàng)建工程

idea中創(chuàng)建項(xiàng)目,項(xiàng)目名稱(chēng):flink-examples

pom.xml



    4.0.0
    com.flink.examples
    flink-examples
    pom
    1.0-SNAPSHOT
    
        stream
        connectors
    

    
        UTF-8
        UTF-8
        1.8
        1.11.1
        8
    

    
        
            org.apache.flink
            flink-streaming-java_2.11
            ${flink.version}
        
        
            org.apache.flink
            flink-clients_2.11
            ${flink.version}
        
        
            org.apache.flink
            flink-table-api-java-bridge_2.11
            ${flink.version}
        
        
            org.apache.flink
            flink-table-planner-blink_2.11
            ${flink.version}
        
        
            org.apache.flink
            flink-table-planner_2.11
            ${flink.version}
            
        
        
            org.apache.flink
            flink-json
            ${flink.version}
            
        
        
            com.google.code.gson
            gson
            2.8.6
        
        
            org.apache.logging.log4j
            log4j-core
            2.11.1
        
    

    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    UTF-8
                    ${compiler.version}
                    ${compiler.version}
                
            

            
                org.apache.maven.plugins
                maven-shade-plugin
                
                    
                        package
                        
                            shade
                        
                    
                
            
        
    

項(xiàng)目分兩個(gè)模塊

flink-examples
|----connectors(中件間連接器示例模塊)
|----examples(模擬電商訂單數(shù)據(jù)并推送到kafka中,以及flink核心數(shù)據(jù)流處理客戶端)
|----stream(數(shù)據(jù)流與算子、方法、窗口等示例模塊)
|----tableapi(table&sql與中件間的使用示例模塊)
|----web(獲取flink算子計(jì)算后的存儲(chǔ)結(jié)果,提供給前端展示模塊)

connectors模塊

pom.xml



    
        com.flink.examples
        flink-examples
        1.0-SNAPSHOT
    
    4.0.0
    connectors

    
        
        
            org.apache.flink
            flink-jdbc_2.11
            1.10.1
        

        
        
            mysql
            mysql-connector-java
            5.1.47
        
        
        
            org.apache.flink
            flink-connector-kafka_2.11
            ${flink.version}
        
        
        
            org.apache.bahir
            flink-connector-redis_2.11
            1.0
        
        
        
            org.apache.flink
            flink-connector-rabbitmq_2.11
            ${flink.version}
        
        
        
            org.apache.flink
            flink-connector-elasticsearch7_2.11
            ${flink.version}
        
        
            org.apache.flink
            flink-sql-connector-elasticsearch7_2.11
            ${flink.version}
        
    

stream模塊

pom.xml



    
        flink-examples
        com.flink.examples
        1.0-SNAPSHOT
    
    4.0.0
    stream
    
        
            org.apache.flink
            flink-table-common
            ${flink.version}
            
        
    

項(xiàng)目全局示例圖

Flink中如何搭建開(kāi)發(fā)環(huán)境與數(shù)據(jù)

示例數(shù)據(jù)類(lèi)

后續(xù)所有算子演示的數(shù)據(jù),均來(lái)自此類(lèi)來(lái)提供公共數(shù)據(jù)。

import org.apache.flink.api.java.tuple.Tuple3;
import java.util.Arrays;
import java.util.List;

/**
 * @Description 公共示例數(shù)據(jù)
 */
public class DataSource {

    /**
     * 示例數(shù)據(jù)集合
     * Tuple3 是一個(gè)固定3個(gè)屬性變量的實(shí)體類(lèi),分別用f0,f1,f2表示三個(gè)構(gòu)造傳參與變量
     * @return
     */
    public static List> getTuple3ToList(){
        //Tuple3 = Tuple3<姓名,性別(man男,girl女),年齡>
        return Arrays.asList(
                new Tuple3<>("張三", "man", 20),
                new Tuple3<>("李四", "girl", 24),
                new Tuple3<>("王五", "man", 29),
                new Tuple3<>("劉六", "girl", 32),
                new Tuple3<>("伍七", "girl", 18),
                new Tuple3<>("吳八", "man", 30)
        );
    }

}

關(guān)于Flink中如何搭建開(kāi)發(fā)環(huán)境與數(shù)據(jù)就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。


當(dāng)前標(biāo)題:Flink中如何搭建開(kāi)發(fā)環(huán)境與數(shù)據(jù)
當(dāng)前路徑:http://weahome.cn/article/gsshsc.html

其他資訊

在線咨詢(xún)

微信咨詢(xún)

電話咨詢(xún)

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部