摘要:基于開發(fā)指南如果基于進(jìn)行應(yīng)用開發(fā),需要在文件中加入如下配置注解注意修改的值,確保其符合您的應(yīng)用。應(yīng)用開發(fā)完成后,可以直接直接運(yùn)行方法,在本地進(jìn)行基本的測(cè)試。
如果基于gradle進(jìn)行應(yīng)用開發(fā),需要在build.gradle文件中加入如下配置:
buildscript {
repositories {
jcenter() // this applies only to the Gradle Shadow plugin
}
dependencies {
classpath com.github.jengelman.gradle.plugins:shadow:2.0.4
}
}
plugins {
id java
id application
// shadow plugin to produce fat JARs
id com.github.johnrengelman.shadow version 2.0.4
}
// artifact properties
group = org.myorg.quickstart
version = 0.1-SNAPSHOT
mainClassName = org.myorg.quickstart.StreamingJob
description = """Flink Quickstart Job"""
ext {
javaVersion = 1.8
flinkVersion = 1.6.4
scalaBinaryVersion = 2.11
slf4jVersion = 1.7.7
log4jVersion = 1.2.17
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
tasks.withType(JavaCompile) {
options.encoding = UTF-8
}
applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
task wrapper(type: Wrapper) {
gradleVersion = 3.1
}
// declare where to find the dependencies of your project
repositories {
mavenCentral()
maven { url "https://repository.apache.org/content/repositories/snapshots/" }
}
// NOTE: We cannot use "compileOnly" or "shadow" configurations since then we could not run code
// in the IDE or with "gradle run". We also cannot exclude transitive dependencies from the
// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
// -> Explicitly define the // libraries we want to be included in the "flinkShadowJar" configuration!
configurations {
flinkShadowJar // dependencies which go into the shadowJar
// always exclude these (also from transitive dependencies) since they are provided by Flink
flinkShadowJar.exclude group: org.apache.flink module: force-shading
flinkShadowJar.exclude group: com.google.code.findbugs module: jsr305
flinkShadowJar.exclude group: org.slf4j
flinkShadowJar.exclude group: log4j
}
// declare the dependencies for your production and test code
dependencies {
// --------------------------------------------------------------
// Compile-time dependencies that should NOT be part of the
// shadow jar and are provided in the lib folder of Flink
// --------------------------------------------------------------
compile "org.apache.flink:flink-java:${flinkVersion}"
compile "org.apache.flink:flink-streaming-java_${scalaBinaryVersion}:${flinkVersion}"
// --------------------------------------------------------------
// Dependencies that should be part of the shadow jar e.g.
// connectors. These must be in the flinkShadowJar configuration!
// --------------------------------------------------------------
//flinkShadowJar "org.apache.flink:flink-connector-kafka-0.11_${scalaBinaryVersion}:${flinkVersion}"
compile "log4j:log4j:${log4jVersion}"
compile "org.slf4j:slf4j-log4j12:${slf4jVersion}"
// Add test dependencies here.
// testCompile "junit:junit:4.12"
}
// make compileOnly dependencies available for tests:
sourceSets {
main.compileClasspath += configurations.flinkShadowJar
main.runtimeClasspath += configurations.flinkShadowJar
test.compileClasspath += configurations.flinkShadowJar
test.runtimeClasspath += configurations.flinkShadowJar
javadoc.classpath += configurations.flinkShadowJar
}
run.classpath = sourceSets.main.runtimeClasspath
jar {
manifest {
attributes Built-By: System.getProperty(user.name)
Build-Jdk: System.getProperty(java.version)
}
}
shadowJar {
configurations = [project.configurations.flinkShadowJar]
}
注解:注意修改mainClassName的值,確保其符合您的應(yīng)用。應(yīng)用開發(fā)完成后,可以直接直接運(yùn)行main方法,在本地進(jìn)行基本的測(cè)試。如果已經(jīng)完成開發(fā)測(cè)試,則直接運(yùn)行shadowJar即可。
實(shí)時(shí)文檔歡迎https://docs.ucloud.cn/ufli
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/126203.html
摘要:基于開發(fā)指南本節(jié)主要介紹如何創(chuàng)建項(xiàng)目,并開發(fā)簡(jiǎn)單的應(yīng)用,從而使該應(yīng)用可以被提交到平臺(tái)運(yùn)行。如果不設(shè)置為,可能會(huì)導(dǎo)致的類沖突,產(chǎn)生不可預(yù)見的問題。在自動(dòng)生成的文件中,使用了來更方便的控制依賴的可見性?;贛aven開發(fā)指南本節(jié)主要介紹如何創(chuàng)建項(xiàng)目,并開發(fā)簡(jiǎn)單的Flink應(yīng)用,從而使該Flink應(yīng)用可以被提交到UFlink平臺(tái)運(yùn)行。==== 自動(dòng)生成代碼框架 ==== 對(duì)于Java開發(fā)者,可以使...
摘要:開發(fā)注意事項(xiàng)基于托管集群的應(yīng)用開發(fā),和自建集群類似,但是仍然有幾個(gè)地方需要注意。和默認(rèn)配置托管集群默認(rèn)指定以及的堆大小為,目前不支持進(jìn)行更改單個(gè)中的數(shù)量設(shè)置為高可用配置應(yīng)用的高可用由集群以及共同保證。配置集群的運(yùn)行時(shí)狀態(tài)保存在的指定目錄中。UFlink開發(fā)注意事項(xiàng)基于UFlink托管集群的Flink應(yīng)用開發(fā),和自建集群類似,但是仍然有幾個(gè)地方需要注意。JobManager和TaskManag...
摘要:什么是實(shí)時(shí)計(jì)算實(shí)時(shí)計(jì)算基于構(gòu)建,為分布式高性能隨時(shí)可用以及準(zhǔn)確的流處理應(yīng)用程序提供流處理框架,可用于流式數(shù)據(jù)處理等應(yīng)用場(chǎng)景。版本支持當(dāng)前支持的版本為,,,可以在提交任務(wù)時(shí)選擇所使用的版本。什么是實(shí)時(shí)計(jì)算實(shí)時(shí)計(jì)算(UFlink)基于ApacheFlink構(gòu)建,為分布式、高性能、隨時(shí)可用以及準(zhǔn)確的流處理應(yīng)用程序提供流處理框架,可用于流式數(shù)據(jù)處理等應(yīng)用場(chǎng)景。產(chǎn)品優(yōu)勢(shì)100%開源兼容基于開源社區(qū)版本...
摘要:開發(fā)指南是為簡(jiǎn)化計(jì)算模型,降低用戶使用實(shí)時(shí)計(jì)算的門檻而設(shè)計(jì)的一套符合標(biāo)準(zhǔn)語義的開發(fā)套件。隨后,將為該表生成字段,用于記錄并表示事件時(shí)間。UFlink SQL 開發(fā)指南UFlink SQL 是 UCloud 為簡(jiǎn)化計(jì)算模型,降低用戶使用實(shí)時(shí)計(jì)算的門檻而設(shè)計(jì)的一套符合標(biāo)準(zhǔn) SQL 語義的開發(fā)套件。接下來,開發(fā)者可以根據(jù)如下內(nèi)容,逐漸熟悉并使用 UFlink SQL 組件所提供的便捷功能。1 ...
摘要:集群管理進(jìn)入集群管理頁面通過集群列表頁面進(jìn)入集群管理頁面獲取集群詳情通過集群列表的詳情按鈕進(jìn)入詳情頁面調(diào)整集群大小點(diǎn)擊調(diào)整容量調(diào)整集群大小查看點(diǎn)擊詳情頁的按鈕查看查看任務(wù)歷史點(diǎn)擊詳情頁的按鈕查看歷史任務(wù)節(jié)點(diǎn)密碼重置點(diǎn)擊集群列表頁的集群管理1. 進(jìn)入集群管理頁面通過UFlink集群列表頁面進(jìn)入集群管理頁面:2. 獲取集群詳情通過集群列表的詳情按鈕進(jìn)入詳情頁面:3. 調(diào)整集群大小點(diǎn)擊調(diào)整容量調(diào)整...
閱讀 3580·2023-04-25 20:09
閱讀 3770·2022-06-28 19:00
閱讀 3115·2022-06-28 19:00
閱讀 3129·2022-06-28 19:00
閱讀 3230·2022-06-28 19:00
閱讀 2917·2022-06-28 19:00
閱讀 3104·2022-06-28 19:00
閱讀 2703·2022-06-28 19:00