├── fiflow-runtime ├── README.md ├── src │ └── main │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.github.myetl.fiflow.core.core.FiflowRuntime └── pom.xml ├── fiflow-core └── src │ └── main │ ├── resources │ ├── demo-mysql-binlog.txt │ ├── demo-elasticsearch.txt │ ├── demo-mysql.txt │ └── demo-kafka.txt │ └── java │ └── com │ └── github │ └── lessonone │ └── fiflow │ └── core │ ├── stream │ ├── TableConnectInfo.java │ ├── NodeType.java │ ├── FlowNode.java │ ├── Flow.java │ ├── FiflowStreamSession.java │ └── Link.java │ ├── frame │ ├── DbInfo.java │ ├── SessionConfig.java │ ├── DbType.java │ ├── JobSubmitResult.java │ ├── FiflowRuntimeLoader.java │ └── FlowSessionManager.java │ ├── flink │ ├── ClusterMode.java │ ├── BuildLevel.java │ └── FlinkClusterInfo.java │ ├── sql │ ├── CmdList.java │ ├── builder │ │ ├── demo │ │ │ ├── DemoMysql.java │ │ │ ├── DemoKafka.java │ │ │ ├── DemoMysqlBinlog.java │ │ │ ├── DemoElasticsearch.java │ │ │ └── DemoBase.java │ │ ├── frame │ │ │ ├── UdfBuilder.java │ │ │ ├── ResetBuilder.java │ │ │ ├── FlinkBuilder.java │ │ │ ├── SetBuilder.java │ │ │ ├── ParallelismBuilder.java │ │ │ └── JarBuilder.java │ │ ├── CreateDatabaseBuilder.java │ │ ├── system │ │ │ ├── ClearBuilder.java │ │ │ ├── QuitBuilder.java │ │ │ ├── UseCatalogBuilder.java │ │ │ ├── ShowCatalogsBuilder.java │ │ │ ├── ShowModulesBuilder.java │ │ │ ├── ShowDatabasesBuilder.java │ │ │ ├── ShowTablesBuilder.java │ │ │ ├── ExplainBuilder.java │ │ │ ├── ShowFunctionsBuilder.java │ │ │ └── UseBuilder.java │ │ ├── AlterDatabaseBuilder.java │ │ ├── AlterTableBuilder.java │ │ ├── DropTableBuilder.java │ │ ├── DropDatabaseBuilder.java │ │ ├── DropViewBuilder.java │ │ ├── CreateTableBuilder.java │ │ ├── InsertOverwriteBuilder.java │ │ ├── CreateViewBuilder.java │ │ ├── InsertIntoBuilder.java │ │ └── SelectBuilder.java │ ├── CmdListImpl.java │ ├── CmdBuilder.java │ ├── FiflowSqlSession.java │ └── TableResultSink.java │ ├── io │ ├── RowCollector.java │ ├── IOSourceFunction.java │ ├── PushExpressionUtils.java │ ├── TypeUtils.java │ └── Operator.java │ ├── util │ ├── StrUtils.java │ ├── Preconditions.java │ ├── SqlParserUtils.java │ └── JarUtils.java │ ├── core │ ├── FiflowRuntime.java │ └── FiflowSession.java │ └── pojo │ └── TableRow.java ├── docs └── fiflow.png ├── fiflow-io ├── README.md ├── fiflow-elasticsearch7 │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── org.apache.flink.table.factories.TableFactory │ │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── lessonone │ │ │ └── fiflow │ │ │ └── io │ │ │ └── elasticsearch7 │ │ │ ├── core │ │ │ ├── EsWriteOptions.java │ │ │ ├── ESReadOptions.java │ │ │ └── ESTableBaseBuilder.java │ │ │ ├── demo │ │ │ ├── DemoBase.java │ │ │ ├── DemoSource.java │ │ │ └── DemoDDL.java │ │ │ ├── ESValidator.java │ │ │ └── ES.java │ ├── pom.xml │ └── README.md ├── fiflow-mysql-binlog │ ├── README.md │ └── pom.xml └── pom.xml ├── fiflow-ui ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── views │ │ ├── flow │ │ │ └── index.vue │ │ ├── layout │ │ │ └── header │ │ │ │ ├── index.js │ │ │ │ ├── index.scss │ │ │ │ └── index.vue │ │ ├── config │ │ │ └── index.vue │ │ ├── datasource │ │ │ └── index.vue │ │ └── monitor │ │ │ └── index.vue │ ├── App.vue │ ├── main.js │ ├── layout.vue │ ├── assets │ │ └── styles │ │ │ ├── variables.scss │ │ │ └── app.scss │ ├── utils │ │ └── ajax.js │ └── components │ │ ├── sql-editor │ │ └── index.vue │ │ └── row-set │ │ └── index.vue ├── babel.config.js ├── README.md └── package.json ├── .gitattributes ├── fiflow-web ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── lessonone │ │ │ └── fiflow │ │ │ └── web │ │ │ ├── config │ │ │ └── WebConfig.java │ │ │ ├── controller │ │ │ ├── PagerEnter.java │ │ │ └── FiflowSqlController.java │ │ │ ├── FiflowWebMain.java │ │ │ ├── model │ │ │ └── SqlCmd.java │ │ │ └── service │ │ │ ├── FiflowService.java │ │ │ └── FiflowSqlService.java │ │ └── resources │ │ ├── static │ │ ├── fonts │ │ │ ├── codicon.a609dc0f.ttf │ │ │ ├── element-icons.732389de.ttf │ │ │ └── element-icons.535877f5.woff │ │ ├── vs │ │ │ ├── base │ │ │ │ └── browser │ │ │ │ │ └── ui │ │ │ │ │ └── codiconLabel │ │ │ │ │ └── codicon │ │ │ │ │ └── codicon.ttf │ │ │ ├── language │ │ │ │ └── typescript │ │ │ │ │ ├── lib │ │ │ │ │ └── typescriptServicesMetadata.js │ │ │ │ │ └── ts.worker.js │ │ │ └── basic-languages │ │ │ │ ├── go │ │ │ │ └── go.contribution.js │ │ │ │ ├── sql │ │ │ │ └── sql.contribution.js │ │ │ │ ├── csp │ │ │ │ └── csp.contribution.js │ │ │ │ ├── lua │ │ │ │ └── lua.contribution.js │ │ │ │ ├── perl │ │ │ │ └── perl.contribution.js │ │ │ │ ├── sb │ │ │ │ └── sb.contribution.js │ │ │ │ ├── vb │ │ │ │ └── vb.contribution.js │ │ │ │ ├── abap │ │ │ │ └── abap.contribution.js │ │ │ │ ├── mysql │ │ │ │ └── mysql.contribution.js │ │ │ │ ├── redis │ │ │ │ └── redis.contribution.js │ │ │ │ ├── bat │ │ │ │ └── bat.contribution.js │ │ │ │ ├── azcli │ │ │ │ └── azcli.contribution.js │ │ │ │ ├── pug │ │ │ │ └── pug.contribution.js │ │ │ │ ├── rust │ │ │ │ └── rust.contribution.js │ │ │ │ ├── shell │ │ │ │ └── shell.contribution.js │ │ │ │ ├── cameligo │ │ │ │ └── cameligo.contribution.js │ │ │ │ ├── msdax │ │ │ │ └── msdax.contribution.js │ │ │ │ ├── r │ │ │ │ └── r.contribution.js │ │ │ │ ├── sophia │ │ │ │ └── sophia.contribution.js │ │ │ │ ├── redshift │ │ │ │ └── redshift.contribution.js │ │ │ │ ├── csharp │ │ │ │ └── csharp.contribution.js │ │ │ │ ├── objective-c │ │ │ │ └── objective-c.contribution.js │ │ │ │ ├── pascaligo │ │ │ │ └── pascaligo.contribution.js │ │ │ │ ├── pgsql │ │ │ │ └── pgsql.contribution.js │ │ │ │ ├── solidity │ │ │ │ └── solidity.contribution.js │ │ │ │ ├── tcl │ │ │ │ └── tcl.contribution.js │ │ │ │ ├── css │ │ │ │ └── css.contribution.js │ │ │ │ ├── scheme │ │ │ │ └── scheme.contribution.js │ │ │ │ ├── postiats │ │ │ │ └── postiats.contribution.js │ │ │ │ ├── st │ │ │ │ └── st.contribution.js │ │ │ │ ├── clojure │ │ │ │ └── clojure.contribution.js │ │ │ │ ├── twig │ │ │ │ └── twig.contribution.js │ │ │ │ ├── swift │ │ │ │ └── swift.contribution.js │ │ │ │ ├── less │ │ │ │ └── less.contribution.js │ │ │ │ ├── razor │ │ │ │ └── razor.contribution.js │ │ │ │ ├── fsharp │ │ │ │ └── fsharp.contribution.js │ │ │ │ ├── powerquery │ │ │ │ └── powerquery.contribution.js │ │ │ │ ├── apex │ │ │ │ └── apex.contribution.js │ │ │ │ ├── powershell │ │ │ │ └── powershell.contribution.js │ │ │ │ ├── scss │ │ │ │ └── scss.contribution.js │ │ │ │ ├── dockerfile │ │ │ │ └── dockerfile.contribution.js │ │ │ │ ├── restructuredtext │ │ │ │ └── restructuredtext.contribution.js │ │ │ │ ├── ruby │ │ │ │ └── ruby.contribution.js │ │ │ │ ├── yaml │ │ │ │ └── yaml.contribution.js │ │ │ │ ├── java │ │ │ │ └── java.contribution.js │ │ │ │ ├── mips │ │ │ │ └── mips.contribution.js │ │ │ │ ├── kotlin │ │ │ │ └── kotlin.contribution.js │ │ │ │ ├── php │ │ │ │ └── php.contribution.js │ │ │ │ ├── graphql │ │ │ │ └── graphql.contribution.js │ │ │ │ ├── pascal │ │ │ │ └── pascal.contribution.js │ │ │ │ ├── markdown │ │ │ │ └── markdown.contribution.js │ │ │ │ ├── typescript │ │ │ │ └── typescript.contribution.js │ │ │ │ ├── python │ │ │ │ └── python.contribution.js │ │ │ │ ├── handlebars │ │ │ │ └── handlebars.contribution.js │ │ │ │ ├── ini │ │ │ │ └── ini.contribution.js │ │ │ │ ├── coffee │ │ │ │ └── coffee.contribution.js │ │ │ │ ├── html │ │ │ │ └── html.contribution.js │ │ │ │ ├── javascript │ │ │ │ └── javascript.contribution.js │ │ │ │ ├── xml │ │ │ │ └── xml.contribution.js │ │ │ │ └── cpp │ │ │ │ └── cpp.contribution.js │ │ ├── js │ │ │ ├── chunk-2d0cefb1.6483d8f3.js │ │ │ ├── chunk-2d0cfe1c.943e18d8.js │ │ │ ├── chunk-2d2300d2.98d1e2fc.js │ │ │ ├── chunk-2d20f934.bfc0b895.js │ │ │ ├── chunk-2d0ba136.8142a877.js │ │ │ ├── chunk-2d0cefb1.6483d8f3.js.map │ │ │ ├── chunk-2d0c4313.90d5ee0f.js │ │ │ ├── chunk-2d2300d2.98d1e2fc.js.map │ │ │ ├── chunk-2d209408.1336e8ff.js │ │ │ ├── chunk-2d0d0645.1afee857.js │ │ │ ├── chunk-2d0e1b57.e7e345f4.js │ │ │ ├── chunk-d93f73e6.55cfad66.js │ │ │ ├── chunk-2d2214b3.bdd98af6.js │ │ │ ├── chunk-2d0afa49.c9730ebc.js │ │ │ ├── chunk-2d2311f7.b2cb76a4.js │ │ │ ├── chunk-2d221799.b021f628.js │ │ │ └── chunk-2d229411.cc9d312d.js │ │ └── css │ │ │ └── chunk-d93f73e6.aed45665.css │ │ └── application.properties └── pom.xml ├── .gitignore ├── README.md └── fiflow-api └── pom.xml /fiflow-runtime/README.md: -------------------------------------------------------------------------------- 1 | # web and api 2 | 3 | 4 | todo -------------------------------------------------------------------------------- /fiflow-core/src/main/resources/demo-mysql-binlog.txt: -------------------------------------------------------------------------------- 1 | read mysql binlog doing -------------------------------------------------------------------------------- /docs/fiflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdaodao/fiflow/HEAD/docs/fiflow.png -------------------------------------------------------------------------------- /fiflow-io/README.md: -------------------------------------------------------------------------------- 1 | # 输入 输出 2 | 3 | ## elasticsearch 4 | 5 | ## mysql binlog 6 | 7 | ## hbase 8 | 9 | -------------------------------------------------------------------------------- /fiflow-ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdaodao/fiflow/HEAD/fiflow-ui/public/favicon.ico -------------------------------------------------------------------------------- /fiflow-ui/src/views/flow/index.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java 2 | *.css linguist-language=java 3 | *.html linguist-language=java 4 | -------------------------------------------------------------------------------- /fiflow-ui/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /fiflow-ui/src/views/layout/header/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'Header', 3 | component: () => import('./index.vue') 4 | } -------------------------------------------------------------------------------- /fiflow-runtime/src/main/resources/META-INF/services/com.github.myetl.fiflow.core.core.FiflowRuntime: -------------------------------------------------------------------------------- 1 | com.github.lessonone.fiflow.runtime.FiflowFlinkRuntime -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/resources/META-INF/services/org.apache.flink.table.factories.TableFactory: -------------------------------------------------------------------------------- 1 | com.github.lessonone.fiflow.io.elasticsearch7.ESFactory -------------------------------------------------------------------------------- /fiflow-web/src/main/java/com/github/lessonone/fiflow/web/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.web.config; 2 | 3 | public class WebConfig { 4 | } 5 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/fonts/codicon.a609dc0f.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdaodao/fiflow/HEAD/fiflow-web/src/main/resources/static/fonts/codicon.a609dc0f.ttf -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/fonts/element-icons.732389de.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdaodao/fiflow/HEAD/fiflow-web/src/main/resources/static/fonts/element-icons.732389de.ttf -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/fonts/element-icons.535877f5.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdaodao/fiflow/HEAD/fiflow-web/src/main/resources/static/fonts/element-icons.535877f5.woff -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/stream/TableConnectInfo.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.stream; 2 | 3 | /** 4 | * 数据表信息 和 连接信息 5 | */ 6 | public class TableConnectInfo { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdaodao/fiflow/HEAD/fiflow-web/src/main/resources/static/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf -------------------------------------------------------------------------------- /fiflow-ui/src/views/config/index.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9090 2 | spring.application.name=fiflow 3 | server.servlet.context-path=/fiflow 4 | 5 | spring.mvc.static-path-pattern=/static/** 6 | spring.resources.static-locations=classpath:/static/ 7 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/java/com/github/lessonone/fiflow/io/elasticsearch7/core/EsWriteOptions.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.io.elasticsearch7.core; 2 | 3 | /** 4 | * 写入数据相关的特定配置 5 | */ 6 | public class EsWriteOptions { 7 | } 8 | -------------------------------------------------------------------------------- /fiflow-ui/src/views/datasource/index.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/frame/DbInfo.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.frame; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 数据库连接信息 7 | */ 8 | public class DbInfo implements Serializable { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/flink/ClusterMode.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.flink; 2 | 3 | /** 4 | * 集群模式 5 | */ 6 | public enum ClusterMode { 7 | local, 8 | standalone, 9 | yarn, 10 | yarnper 11 | } 12 | -------------------------------------------------------------------------------- /fiflow-core/src/main/resources/demo-elasticsearch.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE student ( 2 | name VARCHAR, 3 | age INT, 4 | class VARCHAR 5 | ) WITH ( 6 | 'connector.type' = 'elasticsearch', 7 | 'connector.index' = 'student' 8 | 'connector.hosts' = '127.0.0.1:9200' 9 | ); -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/frame/SessionConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.frame; 2 | 3 | /** 4 | * session 配置信息 包括 5 | * 任务的配置信息 以及 flink 集群的连接信息 6 | */ 7 | public class SessionConfig { 8 | public int parallelism = 1; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/stream/NodeType.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.stream; 2 | 3 | 4 | /** 5 | * 节点类型 6 | */ 7 | public enum NodeType { 8 | Table, 9 | Filter, 10 | Map, 11 | Flatmap, 12 | Join, 13 | Project 14 | } 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/language/typescript/lib/typescriptServicesMetadata.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports"], function (require, exports) { 2 | "use strict"; 3 | Object.defineProperty(exports, "__esModule", { value: true }); 4 | exports.typescriptVersion = "3.7.5"; 5 | }); 6 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/frame/DbType.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.frame; 2 | 3 | /** 4 | * 数据库类型 5 | */ 6 | public enum DbType { 7 | Jdbc, 8 | Hive, 9 | Kafka, 10 | Hbase, 11 | Elasticsearch, 12 | Csv, 13 | Binlog 14 | } 15 | -------------------------------------------------------------------------------- /fiflow-ui/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/CmdList.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql; 2 | 3 | import java.util.List; 4 | 5 | public interface CmdList { 6 | 7 | void addCmd(Cmd cmd); 8 | 9 | void addCmdAll(List cmds); 10 | 11 | List getCmdList(); 12 | 13 | void setCmdList(List cmdList); 14 | } 15 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/stream/FlowNode.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.stream; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * flow 中的一个节点 7 | */ 8 | public class FlowNode implements Serializable { 9 | // 节点 id 10 | private String id; 11 | // 节点类型 12 | private NodeType type; 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/frame/JobSubmitResult.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.frame; 2 | 3 | public class JobSubmitResult { 4 | private final String jobId; 5 | 6 | public JobSubmitResult(String jobId) { 7 | this.jobId = jobId; 8 | } 9 | 10 | public String getJobId() { 11 | return jobId; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/io/RowCollector.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.io; 2 | 3 | import org.apache.flink.types.Row; 4 | 5 | public interface RowCollector { 6 | 7 | void collect(Row record); 8 | 9 | public default void complete() { 10 | 11 | } 12 | 13 | public default void error(Exception e) { 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d0cefb1.6483d8f3.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cefb1"],{6287:function(n,e,t){"use strict";t.r(e);var c=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[n._v(" flow 数据流任务 ")])},l=[],u=t("2877"),o={},r=Object(u["a"])(o,c,l,!1,null,null,null);e["default"]=r.exports}}]); 2 | //# sourceMappingURL=chunk-2d0cefb1.6483d8f3.js.map -------------------------------------------------------------------------------- /fiflow-web/src/main/java/com/github/lessonone/fiflow/web/controller/PagerEnter.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.web.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | @Controller 7 | public class PagerEnter { 8 | 9 | @GetMapping({"", "/index"}) 10 | public String index() { 11 | return "/static/index.html"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/stream/Flow.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.stream; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | /** 8 | * 使用节点 连线方式的完整的任务描述 9 | */ 10 | public class Flow implements Serializable { 11 | private List nodes = new ArrayList<>(); 12 | private List links = new ArrayList<>(); 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/java/com/github/lessonone/fiflow/web/FiflowWebMain.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.web; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class FiflowWebMain { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(FiflowWebMain.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d0cfe1c.943e18d8.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cfe1c"],{6639:function(n,e,t){"use strict";t.r(e);var c=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[n._v(" datasource ")])},u=[],a={data:function(){return{}},methods:{}},r=a,o=t("2877"),s=Object(o["a"])(r,c,u,!1,null,null,null);e["default"]=s.exports}}]); 2 | //# sourceMappingURL=chunk-2d0cfe1c.943e18d8.js.map -------------------------------------------------------------------------------- /fiflow-ui/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import router from './router.js' 4 | import ElementUI from 'element-ui'; 5 | import App from './App.vue' 6 | import 'element-ui/lib/theme-chalk/index.css'; 7 | 8 | Vue.use(VueRouter) 9 | Vue.use(ElementUI, { size: 'small' }) 10 | 11 | Vue.config.productionTip = false 12 | 13 | 14 | new Vue({ 15 | el: '#app', 16 | router: router, 17 | render: h => h(App) 18 | }); 19 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/java/com/github/lessonone/fiflow/io/elasticsearch7/core/ESReadOptions.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.io.elasticsearch7.core; 2 | 3 | /** 4 | * 读取数据相关的特定配置 5 | */ 6 | public class ESReadOptions { 7 | 8 | public static Builder builder() { 9 | return new Builder(); 10 | } 11 | 12 | public static class Builder { 13 | 14 | public ESReadOptions build() { 15 | return new ESReadOptions(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fiflow-ui/README.md: -------------------------------------------------------------------------------- 1 | # my-ui 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn run build 16 | ``` 17 | 18 | ### Run your tests 19 | ``` 20 | yarn run test 21 | ``` 22 | 23 | ### Lints and fixes files 24 | ``` 25 | yarn run lint 26 | ``` 27 | 28 | ### Customize configuration 29 | See [Configuration Reference](https://cli.vuejs.org/config/). 30 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/util/StrUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.util; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | 5 | import java.util.Objects; 6 | import java.util.Optional; 7 | 8 | public class StrUtils { 9 | 10 | public static String toString(Optional optional) { 11 | if (!optional.isPresent()) { 12 | return StringUtils.EMPTY; 13 | } 14 | return Objects.toString(optional.get()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /fiflow-ui/src/layout.vue: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/demo/DemoMysql.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.demo; 2 | 3 | public class DemoMysql extends DemoBase { 4 | 5 | public DemoMysql() { 6 | super("mysql"); 7 | } 8 | 9 | @Override 10 | public String help() { 11 | return "demo mysql; jdbc simple demo"; 12 | } 13 | 14 | @Override 15 | protected String demoFileName() { 16 | return "demo-mysql.txt"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d2300d2.98d1e2fc.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2300d2"],{eb43:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container"},[n("div",{staticStyle:{margin:"7px","font-weight":"bold"}},[t._v(" "+t._s(this.$route.meta.title)+" ")]),n("router-view")],1)},s=[],a=n("2877"),l={},r=Object(a["a"])(l,i,s,!1,null,null,null);e["default"]=r.exports}}]); 2 | //# sourceMappingURL=chunk-2d2300d2.98d1e2fc.js.map -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/core/FiflowRuntime.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.core; 2 | 3 | import com.github.lessonone.fiflow.core.frame.JobSubmitResult; 4 | 5 | /** 6 | * 用于把 session 中 构建的任务 提交到 flink 中执行 7 | */ 8 | public interface FiflowRuntime { 9 | 10 | /** 11 | * 提交任务 这里只返回任务id 任务状态什么的单独获取 12 | * 13 | * @param sessionContext 14 | * @return 15 | * @throws Exception 16 | */ 17 | JobSubmitResult submit(SessionContext sessionContext) throws Exception; 18 | } 19 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/demo/DemoKafka.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.demo; 2 | 3 | 4 | public class DemoKafka extends DemoBase { 5 | 6 | public DemoKafka() { 7 | super("kafka"); 8 | } 9 | 10 | @Override 11 | public String help() { 12 | return "demo kafka; read from kafka then sink to mysql simple demo"; 13 | } 14 | 15 | @Override 16 | protected String demoFileName() { 17 | return "demo-kafka.txt"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/io/IOSourceFunction.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.io; 2 | 3 | import org.apache.flink.annotation.Public; 4 | import org.apache.flink.api.java.typeutils.ResultTypeQueryable; 5 | import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction; 6 | import org.apache.flink.types.Row; 7 | 8 | @Public 9 | public abstract class IOSourceFunction extends RichParallelSourceFunction implements ResultTypeQueryable { 10 | 11 | public boolean isBounded() { 12 | return false; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/demo/DemoMysqlBinlog.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.demo; 2 | 3 | public class DemoMysqlBinlog extends DemoBase { 4 | 5 | public DemoMysqlBinlog() { 6 | super("mysql-binlog"); 7 | } 8 | 9 | @Override 10 | public String help() { 11 | return "demo mysql-binlog [doing]; read mysql binlog"; 12 | } 13 | 14 | @Override 15 | protected String demoFileName() { 16 | return "demo-mysql-binlog.txt"; 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/demo/DemoElasticsearch.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.demo; 2 | 3 | public class DemoElasticsearch extends DemoBase { 4 | 5 | public DemoElasticsearch() { 6 | super("elasticsearch"); 7 | } 8 | 9 | @Override 10 | public String help() { 11 | return "demo elasticsearch; read and write elasticsearch"; 12 | } 13 | 14 | @Override 15 | protected String demoFileName() { 16 | return "demo-elasticsearch.txt"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-mysql-binlog/README.md: -------------------------------------------------------------------------------- 1 | # mysql binlog reader 2 | 3 | 使用 alibaba canal 4 | 5 | ## 配置 mysql 开启 binlog 6 | 7 | - my.cnf 中配置如下 8 | ``` 9 | [mysqld] 10 | log-bin=mysql-bin # 开启 binlog 11 | binlog-format=ROW # 选择 ROW 模式 12 | server_id=1 # 配置 MySQL replaction 需要定义,不要和 canal 的 slaveId 重复 13 | ``` 14 | 15 | - 授权 canal 链接 MySQL 账号具有作为 MySQL slave 的权限, 如果已有账户可直接 grant 16 | ``` 17 | CREATE USER canal IDENTIFIED BY 'canal'; 18 | GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'canal'@'%'; 19 | -- GRANT ALL PRIVILEGES ON *.* TO 'canal'@'%' ; 20 | FLUSH PRIVILEGES; 21 | ``` 22 | 23 | ## ddl 24 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/stream/FiflowStreamSession.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.stream; 2 | 3 | import com.github.lessonone.fiflow.core.core.FiflowSession; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.frame.SessionConfig; 6 | 7 | public class FiflowStreamSession extends FiflowSession { 8 | 9 | public FiflowStreamSession(String id, SessionConfig sessionConfig) { 10 | super(id, sessionConfig); 11 | } 12 | 13 | 14 | public FlinkBuildInfo build(Flow flow) { 15 | 16 | 17 | return null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | # Compiled class file 23 | .idea 24 | *test.md 25 | *Test.java 26 | *test 27 | /.idea/* 28 | .vertx/ 29 | target/ 30 | *.class 31 | *.iml 32 | # Log file 33 | *.log 34 | 35 | # BlueJ files 36 | *.ctxt 37 | 38 | .mtj.tmp/ 39 | 40 | # Package Files # 41 | *.jar 42 | *.war 43 | *.nar 44 | *.ear 45 | *.zip 46 | *.tar.gz 47 | *.rar 48 | hs_err_pid* 49 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/java/com/github/lessonone/fiflow/io/elasticsearch7/core/ESTableBaseBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.io.elasticsearch7.core; 2 | 3 | import org.apache.flink.table.api.TableSchema; 4 | 5 | 6 | public abstract class ESTableBaseBuilder { 7 | protected ESOptions esOptions; 8 | protected TableSchema schema; 9 | 10 | public ESTableBaseBuilder setEsOptions(ESOptions esOptions) { 11 | this.esOptions = esOptions; 12 | return this; 13 | } 14 | 15 | public ESTableBaseBuilder setSchema(TableSchema schema) { 16 | this.schema = schema; 17 | return this; 18 | } 19 | 20 | public abstract T build(); 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /fiflow-ui/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <%= htmlWebpackPlugin.options.title %> 10 | 11 | 12 | 13 | 17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/frame/FiflowRuntimeLoader.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.frame; 2 | 3 | import com.github.lessonone.fiflow.core.core.FiflowRuntime; 4 | 5 | import java.util.ServiceLoader; 6 | 7 | /** 8 | * 加载 fiflow flink 运行时 9 | */ 10 | public class FiflowRuntimeLoader { 11 | 12 | /** 13 | * 获取 fiflow 运行时 14 | * 15 | * @return 16 | */ 17 | public static FiflowRuntime getRuntime() { 18 | ServiceLoader runtime = ServiceLoader.load(FiflowRuntime.class); 19 | if (!runtime.iterator().hasNext()) { 20 | throw new RuntimeException("no fiflow runtime provided."); 21 | } 22 | return runtime.iterator().next(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fiflow-web/src/main/java/com/github/lessonone/fiflow/web/model/SqlCmd.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.web.model; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 前端向后端传递的 sql 命令 7 | */ 8 | public class SqlCmd implements Serializable { 9 | // 待执行的sql text 为多行以;分隔的sql语句 10 | private String sql; 11 | // session id 可以为空 为空会新建一个session 12 | private String sessionId; 13 | 14 | public String getSql() { 15 | return sql; 16 | } 17 | 18 | public SqlCmd setSql(String sql) { 19 | this.sql = sql; 20 | return this; 21 | } 22 | 23 | public String getSessionId() { 24 | return sessionId; 25 | } 26 | 27 | public SqlCmd setSessionId(String sessionId) { 28 | this.sessionId = sessionId; 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/CmdListImpl.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class CmdListImpl implements CmdList { 7 | private List cmdList = new ArrayList<>(); 8 | 9 | @Override 10 | public void addCmd(Cmd cmd) { 11 | if (cmd != null) 12 | cmdList.add(cmd); 13 | } 14 | 15 | @Override 16 | public void addCmdAll(List cmds) { 17 | if (cmds != null) 18 | cmdList.addAll(cmds); 19 | } 20 | 21 | @Override 22 | public List getCmdList() { 23 | return cmdList; 24 | } 25 | 26 | @Override 27 | public void setCmdList(List cmdList) { 28 | this.cmdList = cmdList; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /fiflow-core/src/main/resources/demo-mysql.txt: -------------------------------------------------------------------------------- 1 | jar mysql,flink-jdbc; 2 | CREATE TABLE student ( 3 | name VARCHAR, 4 | age INT, 5 | class VARCHAR 6 | ) WITH ( 7 | 'connector.type' = 'jdbc', 8 | 'connector.url' = 'jdbc:mysql://127.0.0.1:3306/flink', 9 | 'connector.table' = 'student', 10 | 'connector.username' = 'root', 11 | 'connector.password' = 'root' 12 | ); 13 | 14 | CREATE TABLE stuout ( 15 | name VARCHAR, 16 | age INT, 17 | class VARCHAR 18 | ) WITH ( 19 | 'connector.type' = 'jdbc', 20 | 'connector.url' = 'jdbc:mysql://127.0.0.1:3306/flink', 21 | 'connector.table' = 'stuout', 22 | 'connector.username' = 'root', 23 | 'connector.password' = 'root' 24 | ); 25 | 26 | insert into stuout(name,age,class) 27 | select name, age, class from student where age > 16 ; -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/util/Preconditions.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.util; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | public final class Preconditions { 8 | 9 | public static T checkNotNull(T reference, @Nullable String errorMessage) { 10 | if (reference == null) { 11 | throw new NullPointerException(String.valueOf(errorMessage)); 12 | } 13 | return reference; 14 | } 15 | 16 | public static String checkNotEmpty(String reference, @Nullable String errorMessage) { 17 | if (StringUtils.isEmpty(reference)) { 18 | throw new NullPointerException(String.valueOf(errorMessage)); 19 | } 20 | return reference; 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /fiflow-web/src/main/java/com/github/lessonone/fiflow/web/service/FiflowService.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.web.service; 2 | 3 | import com.github.lessonone.fiflow.core.frame.FlowSessionManager; 4 | import com.github.lessonone.fiflow.core.frame.SessionConfig; 5 | import com.github.lessonone.fiflow.core.sql.FiflowSqlSession; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class FiflowService { 10 | 11 | /** 12 | * 获取或者创建 session 13 | * 14 | * @param sessionId 15 | * @return 16 | */ 17 | public FiflowSqlSession getOrCreateSession(String sessionId) { 18 | SessionConfig sessionConfig = new SessionConfig(); 19 | 20 | FiflowSqlSession session = FlowSessionManager.getOrCreateSession(sessionId, sessionConfig); 21 | 22 | return session; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-mysql-binlog/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | fiflow-io 7 | com.github.lessonone 8 | 1.10-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | fiflow-mysql-binlog 13 | 14 | 15 | 16 | com.alibaba.otter 17 | canal.parse 18 | 1.1.4 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/css/chunk-d93f73e6.aed45665.css: -------------------------------------------------------------------------------- 1 | .layout-header{position:fixed;z-index:10;left:0;right:0;top:0;width:100%;height:40px;line-height:40px;padding:0 40px;background-color:#252a2f;color:hsla(0,0%,100%,.8);-webkit-box-shadow:0 1px 6px rgba(0,0,0,.2);box-shadow:0 1px 6px rgba(0,0,0,.2);clear:both}.layout-header .logo{display:inline-block;vertical-align:top;font-size:26px;color:#eee}.layout-header .logo .logo-main-titile{font-size:24px;height:40px;line-height:40px;font-weight:700}.layout-header .logo .logo-sub-title{font-size:12px;height:40px;line-height:40px}.layout-header .logo .logo-sub-title .logo-sub-title-main{font-weight:700}.layout-header .el-menu{display:inline-block!important;margin-left:60px}.layout-header .el-menu .el-menu-item,.layout-header .el-menu .el-submenu,.layout-header .el-menu .el-submenu__title{line-height:39px!important;height:39px!important} -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d20f934.bfc0b895.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d20f934"],{b3e2:function(a,e,t){"use strict";t.r(e);var l=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("el-table",{staticStyle:{width:"100%"},attrs:{data:a.tableData,stripe:""}},[t("el-table-column",{attrs:{prop:"date",label:"日期",width:"180"}}),t("el-table-column",{attrs:{prop:"name",label:"姓名",width:"180"}}),t("el-table-column",{attrs:{prop:"address",label:"地址"}})],1)},n=[],d={data:function(){return{tableData:[{date:"2016-05-02",name:"王小虎",address:"上海市普陀区金沙江路 1518 弄"},{date:"2016-05-04",name:"王小虎",address:"上海市普陀区金沙江路 1517 弄"},{date:"2016-05-01",name:"王小虎",address:"上海市普陀区金沙江路 1519 弄"},{date:"2016-05-03",name:"王小虎",address:"上海市普陀区金沙江路 1516 弄"}]}}},s=d,r=t("2877"),u=Object(r["a"])(s,l,n,!1,null,null,null);e["default"]=u.exports}}]); 2 | //# sourceMappingURL=chunk-2d20f934.bfc0b895.js.map -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/go/go.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'go', 10 | extensions: ['.go'], 11 | aliases: ['Go'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./go'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/sql/sql.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'sql', 10 | extensions: ['.sql'], 11 | aliases: ['SQL'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./sql'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/language/typescript/ts.worker.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "monaco-editor-core/esm/vs/editor/editor.worker", "./tsWorker"], function (require, exports, worker, tsWorker_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | self.onmessage = function () { 9 | // ignore the first message 10 | worker.initialize(function (ctx, createData) { 11 | return new tsWorker_1.TypeScriptWorker(ctx, createData); 12 | }); 13 | }; 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/csp/csp.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'csp', 10 | extensions: [], 11 | aliases: ['CSP', 'csp'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./csp'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/lua/lua.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'lua', 10 | extensions: ['.lua'], 11 | aliases: ['Lua', 'lua'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./lua'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/perl/perl.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'perl', 10 | extensions: ['.pl'], 11 | aliases: ['Perl', 'pl'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./perl'], resolve_1, reject_1); }); }, 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/sb/sb.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'sb', 10 | extensions: ['.sb'], 11 | aliases: ['Small Basic', 'sb'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./sb'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/vb/vb.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'vb', 10 | extensions: ['.vb'], 11 | aliases: ['Visual Basic', 'vb'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./vb'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/java/com/github/lessonone/fiflow/io/elasticsearch7/demo/DemoBase.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.io.elasticsearch7.demo; 2 | 3 | import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; 4 | import org.apache.flink.table.api.EnvironmentSettings; 5 | import org.apache.flink.table.api.java.StreamTableEnvironment; 6 | 7 | public class DemoBase { 8 | 9 | public static StreamExecutionEnvironment env; 10 | public static StreamTableEnvironment tEnv; 11 | 12 | 13 | static { 14 | env = StreamExecutionEnvironment.getExecutionEnvironment(); 15 | env.setParallelism(1); 16 | 17 | tEnv = StreamTableEnvironment 18 | .create(env, EnvironmentSettings 19 | .newInstance() 20 | .inStreamingMode() 21 | .useBlinkPlanner() 22 | .build()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/abap/abap.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'abap', 10 | extensions: ['.abap'], 11 | aliases: ['abap', 'ABAP'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./abap'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/mysql/mysql.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'mysql', 10 | extensions: [], 11 | aliases: ['MySQL', 'mysql'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./mysql'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/redis/redis.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'redis', 10 | extensions: ['.redis'], 11 | aliases: ['redis'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./redis'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/java/com/github/lessonone/fiflow/web/service/FiflowSqlService.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.web.service; 2 | 3 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 4 | import com.github.lessonone.fiflow.core.sql.FiflowSqlSession; 5 | import com.github.lessonone.fiflow.web.model.SqlCmd; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * 使用 fiflow 在 flink 中执行 sql 11 | */ 12 | @Service 13 | public class FiflowSqlService { 14 | @Autowired 15 | private FiflowService fiflowService; 16 | 17 | /** 18 | * todo 19 | * 20 | * @param cmd 21 | * @throws Exception 22 | */ 23 | public FlinkBuildInfo run(SqlCmd cmd) throws Exception { 24 | FiflowSqlSession session = fiflowService.getOrCreateSession(cmd.getSessionId()); 25 | 26 | return session.sql(cmd.getSql()); 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/bat/bat.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'bat', 10 | extensions: ['.bat', '.cmd'], 11 | aliases: ['Batch', 'bat'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./bat'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d0ba136.8142a877.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0ba136"],{3652:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return o})),n.d(t,"language",(function(){return s}));var o={comments:{lineComment:"#"}},s={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}}}}]); 2 | //# sourceMappingURL=chunk-2d0ba136.8142a877.js.map -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/azcli/azcli.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'azcli', 10 | extensions: ['.azcli'], 11 | aliases: ['Azure CLI', 'azcli'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./azcli'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/pug/pug.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'pug', 10 | extensions: ['.jade', '.pug'], 11 | aliases: ['Pug', 'Jade', 'jade'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./pug'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/rust/rust.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'rust', 10 | extensions: ['.rs', '.rlib'], 11 | aliases: ['Rust', 'rust'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./rust'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/shell/shell.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'shell', 10 | extensions: ['.sh', '.bash'], 11 | aliases: ['Shell', 'sh'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./shell'], resolve_1, reject_1); }); }, 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/cameligo/cameligo.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'cameligo', 10 | extensions: ['.mligo'], 11 | aliases: ['Cameligo'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./cameligo'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/msdax/msdax.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'msdax', 10 | extensions: ['.dax', '.msdax'], 11 | aliases: ['DAX', 'MSDAX'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./msdax'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/r/r.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'r', 10 | extensions: ['.r', '.rhistory', '.rprofile', '.rt'], 11 | aliases: ['R', 'r'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./r'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/sophia/sophia.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'aes', 10 | extensions: ['.aes'], 11 | aliases: ['aes', 'sophia', 'Sophia'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./sophia'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/redshift/redshift.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'redshift', 10 | extensions: [], 11 | aliases: ['Redshift', 'redshift'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./redshift'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/csharp/csharp.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'csharp', 10 | extensions: ['.cs', '.csx', '.cake'], 11 | aliases: ['C#', 'csharp'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./csharp'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/objective-c/objective-c.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'objective-c', 10 | extensions: ['.m'], 11 | aliases: ['Objective-C'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./objective-c'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/pascaligo/pascaligo.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'pascaligo', 10 | extensions: ['.ligo'], 11 | aliases: ['Pascaligo', 'ligo'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./pascaligo'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/pgsql/pgsql.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'pgsql', 10 | extensions: [], 11 | aliases: ['PostgreSQL', 'postgres', 'pg', 'postgre'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./pgsql'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/solidity/solidity.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'sol', 10 | extensions: ['.sol'], 11 | aliases: ['sol', 'solidity', 'Solidity'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./solidity'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/tcl/tcl.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'tcl', 10 | extensions: ['.tcl'], 11 | aliases: ['tcl', 'Tcl', 'tcltk', 'TclTk', 'tcl/tk', 'Tcl/Tk'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./tcl'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/css/css.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'css', 10 | extensions: ['.css'], 11 | aliases: ['CSS', 'css'], 12 | mimetypes: ['text/css'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./css'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/scheme/scheme.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'scheme', 10 | extensions: ['.scm', '.ss', '.sch', '.rkt'], 11 | aliases: ['scheme', 'Scheme'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./scheme'], resolve_1, reject_1); }); }, 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/postiats/postiats.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'postiats', 10 | extensions: ['.dats', '.sats', '.hats'], 11 | aliases: ['ATS', 'ATS/Postiats'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./postiats'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/st/st.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'st', 10 | extensions: ['.st', '.iecst', '.iecplc', '.lc3lib'], 11 | aliases: ['StructuredText', 'scl', 'stl'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./st'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/clojure/clojure.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'clojure', 10 | extensions: ['.clj', '.cljs', '.cljc', '.edn'], 11 | aliases: ['clojure', 'Clojure'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./clojure'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/twig/twig.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'twig', 10 | extensions: ['.twig'], 11 | aliases: ['Twig', 'twig'], 12 | mimetypes: ['text/x-twig'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./twig'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/swift/swift.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'swift', 10 | aliases: ['Swift', 'swift'], 11 | extensions: ['.swift'], 12 | mimetypes: ['text/swift'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./swift'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/less/less.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'less', 10 | extensions: ['.less'], 11 | aliases: ['Less', 'less'], 12 | mimetypes: ['text/x-less', 'text/less'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./less'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/razor/razor.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'razor', 10 | extensions: ['.cshtml'], 11 | aliases: ['Razor', 'razor'], 12 | mimetypes: ['text/x-cshtml'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./razor'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/fsharp/fsharp.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'fsharp', 10 | extensions: ['.fs', '.fsi', '.ml', '.mli', '.fsx', '.fsscript'], 11 | aliases: ['F#', 'FSharp', 'fsharp'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./fsharp'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/powerquery/powerquery.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'powerquery', 10 | extensions: ['.pq', '.pqm'], 11 | aliases: ['PQ', 'M', 'Power Query', 'Power Query M'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./powerquery'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/apex/apex.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'apex', 10 | extensions: ['.cls'], 11 | aliases: ['Apex', 'apex'], 12 | mimetypes: ['text/x-apex-source', 'text/x-apex'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./apex'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/powershell/powershell.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'powershell', 10 | extensions: ['.ps1', '.psm1', '.psd1'], 11 | aliases: ['PowerShell', 'powershell', 'ps', 'ps1'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./powershell'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/scss/scss.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'scss', 10 | extensions: ['.scss'], 11 | aliases: ['Sass', 'sass', 'scss'], 12 | mimetypes: ['text/x-scss', 'text/scss'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./scss'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/frame/UdfBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.frame; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | public class UdfBuilder extends CmdBaseBuilder implements CmdBuilder { 11 | public static final String pattern = "-*\\s?udf\\s+(.*)"; 12 | 13 | public UdfBuilder() { 14 | super(pattern); 15 | } 16 | 17 | @Override 18 | public BuildLevel buildLevel() { 19 | return BuildLevel.Set; 20 | } 21 | 22 | @Override 23 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 24 | return null; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/dockerfile/dockerfile.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'dockerfile', 10 | extensions: ['.dockerfile'], 11 | filenames: ['Dockerfile'], 12 | aliases: ['Dockerfile'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./dockerfile'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/restructuredtext/restructuredtext.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'restructuredtext', 10 | extensions: ['.rst'], 11 | aliases: ['reStructuredText', 'restructuredtext'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./restructuredtext'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/ruby/ruby.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'ruby', 10 | extensions: ['.rb', '.rbx', '.rjs', '.gemspec', '.pp'], 11 | filenames: ['rakefile'], 12 | aliases: ['Ruby', 'rb'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./ruby'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/yaml/yaml.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'yaml', 10 | extensions: ['.yaml', '.yml'], 11 | aliases: ['YAML', 'yaml', 'YML', 'yml'], 12 | mimetypes: ['application/x-yaml'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./yaml'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/CreateDatabaseBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | 9 | /** 10 | * create database 11 | */ 12 | public class CreateDatabaseBuilder extends CmdBaseBuilder implements CmdBuilder { 13 | public static final String pattern = "(CREATE\\s+DATABASE\\s+.*)"; 14 | 15 | public CreateDatabaseBuilder() { 16 | super(pattern); 17 | } 18 | 19 | @Override 20 | public BuildLevel buildLevel() { 21 | return BuildLevel.Create; 22 | } 23 | 24 | @Override 25 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/java/java.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'java', 10 | extensions: ['.java', '.jav'], 11 | aliases: ['Java', 'java'], 12 | mimetypes: ['text/x-java-source', 'text/x-java'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./java'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/mips/mips.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'mips', 10 | extensions: ['.s'], 11 | aliases: ['MIPS', 'MIPS-V'], 12 | mimetypes: ['text/x-mips', 'text/mips', 'text/plaintext'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./mips'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/kotlin/kotlin.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'kotlin', 10 | extensions: ['.kt'], 11 | aliases: ['Kotlin', 'kotlin'], 12 | mimetypes: ['text/x-kotlin-source', 'text/x-kotlin'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./kotlin'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/php/php.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'php', 10 | extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'], 11 | aliases: ['PHP', 'php'], 12 | mimetypes: ['application/x-php'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./php'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/graphql/graphql.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'graphql', 10 | extensions: ['.graphql', '.gql'], 11 | aliases: ['GraphQL', 'graphql', 'gql'], 12 | mimetypes: ['application/graphql'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./graphql'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/pascal/pascal.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'pascal', 10 | extensions: ['.pas', '.p', '.pp'], 11 | aliases: ['Pascal', 'pas'], 12 | mimetypes: ['text/x-pascal-source', 'text/x-pascal'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./pascal'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/frame/ResetBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.frame; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * reset 12 | */ 13 | public class ResetBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "RESET"; 15 | 16 | public ResetBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public BuildLevel buildLevel() { 22 | return BuildLevel.Set; 23 | } 24 | 25 | @Override 26 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 27 | return null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/markdown/markdown.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'markdown', 10 | extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'], 11 | aliases: ['Markdown', 'markdown'], 12 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./markdown'], resolve_1, reject_1); }); } 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/typescript/typescript.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'typescript', 10 | extensions: ['.ts', '.tsx'], 11 | aliases: ['TypeScript', 'ts', 'typescript'], 12 | mimetypes: ['text/typescript'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./typescript'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/ClearBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * clear 12 | */ 13 | public class ClearBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "CLEAR"; 15 | 16 | public ClearBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public BuildLevel buildLevel() { 22 | return BuildLevel.Set; 23 | } 24 | 25 | @Override 26 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 27 | return null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/python/python.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'python', 10 | extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'], 11 | aliases: ['Python', 'py'], 12 | firstLine: '^#!/.*\\bpython[0-9.-]*\\b', 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./python'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/handlebars/handlebars.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'handlebars', 10 | extensions: ['.handlebars', '.hbs'], 11 | aliases: ['Handlebars', 'handlebars'], 12 | mimetypes: ['text/x-handlebars-template'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./handlebars'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/ini/ini.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'ini', 10 | extensions: ['.ini', '.properties', '.gitconfig'], 11 | filenames: ['config', '.gitattributes', '.gitconfig', '.editorconfig'], 12 | aliases: ['Ini', 'ini'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./ini'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/coffee/coffee.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'coffeescript', 10 | extensions: ['.coffee'], 11 | aliases: ['CoffeeScript', 'coffeescript', 'coffee'], 12 | mimetypes: ['text/x-coffeescript', 'text/coffeescript'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./coffee'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/util/SqlParserUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.util; 2 | 3 | import org.apache.calcite.config.Lex; 4 | import org.apache.calcite.sql.SqlNode; 5 | import org.apache.calcite.sql.parser.SqlParseException; 6 | import org.apache.calcite.sql.parser.SqlParser; 7 | import org.apache.flink.sql.parser.impl.FlinkSqlParserImpl; 8 | import org.apache.flink.sql.parser.validate.FlinkSqlConformance; 9 | import org.apache.flink.table.planner.calcite.CalciteParser; 10 | 11 | /** 12 | * sql 解析 13 | */ 14 | public class SqlParserUtils { 15 | private static final SqlParser.Config PARSER_CONFIG = SqlParser 16 | .configBuilder() 17 | .setParserFactory(FlinkSqlParserImpl.FACTORY) 18 | .setConformance(FlinkSqlConformance.DEFAULT) 19 | .setLex(Lex.JAVA) 20 | .build(); 21 | private static final CalciteParser parser = new CalciteParser(PARSER_CONFIG); 22 | 23 | public static SqlNode parse(String sql) throws SqlParseException { 24 | return parser.parse(sql); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 基于flink的数据流处理系统 2 | 基于 apache flink1.10 3 | 4 | 5 | ## 如何运行 6 | - 运行 FiflowWebMain 7 | - 访问 http://localhost:9090/fiflow 8 | 9 | ## 如何使用 10 | 在输入框中输入 help 给出提示信息; 11 | 12 | ![如何使用](./docs/fiflow.png) 13 | 14 | - demo mysql : jdbc 示例 15 | - demo kafka : kafka 示例 16 | - demo elasticsearch : elasticsearch 示例 17 | - demo mysql-binlog : mysql-binlog 示例 doing 18 | 19 | ## 模块划分 20 | - fiflow-ui web页面 sql的执行 和 任务的创建 管理 21 | - fiflow-web 与前端对应的后台 22 | - fiflow-api fiflow 对外提供的操作api 23 | - fiflow-core flink 操作的封装 24 | - fiflow-io 输入 输出 25 | - fiflow-runtime 提交任务到flink local、standalone、yarn 以及与flink集群的交互 26 | 27 | 28 | ## fiflow-io 29 | - [Elasticsearch](./fiflow-io/fiflow-elasticsearch7/README.md) 读写 30 | > 支持谓词下推和异步维表join, 按 shard 分片读取数据 31 | 支持append和retract写(90% complete) 32 | 33 | - mysql binlog doing 34 | - hbase todo 35 | - ... todo 36 | 37 | 38 | ## todo 39 | - flink 集群管理 40 | - 任务管理 41 | - 使用 数据源管理功能 取代 create table 操作 42 | 43 | ## Thanks 44 | - flink 45 | - zeppelin 46 | - spring boot 47 | - flinkx 48 | - vue 49 | - element-ui 50 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/html/html.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'html', 10 | extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'], 11 | aliases: ['HTML', 'htm', 'html', 'xhtml'], 12 | mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'], 13 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./html'], resolve_1, reject_1); }); } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/javascript/javascript.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'javascript', 10 | extensions: ['.js', '.es6', '.jsx'], 11 | firstLine: '^#!.*\\bnode', 12 | filenames: ['jakefile'], 13 | aliases: ['JavaScript', 'javascript', 'js'], 14 | mimetypes: ['text/javascript'], 15 | loader: function () { return new Promise(function (resolve_1, reject_1) { require(['./javascript'], resolve_1, reject_1); }); } 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /fiflow-ui/src/views/monitor/index.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d0cefb1.6483d8f3.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/views/flow/index.vue?d5eb","webpack:///./src/views/flow/index.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","_v","staticRenderFns","script","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACJ,EAAIM,GAAG,mBAC7GC,EAAkB,G,YCAlBC,EAAS,GAKTC,EAAY,eACdD,EACAT,EACAQ,GACA,EACA,KACA,KACA,MAIa,aAAAE,E","file":"static/js/chunk-2d0cefb1.6483d8f3.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._v(\" flow 数据流任务 \")])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=6cb0b4d4&\"\nvar script = {}\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} -------------------------------------------------------------------------------- /fiflow-ui/src/assets/styles/variables.scss: -------------------------------------------------------------------------------- 1 | // Base 2 | $body-background : #eee; 3 | $font-family : "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif; 4 | $code-family : Consolas,Menlo,Courier,monospace; 5 | $title-color : #17233d; 6 | $text-color : #515a6e; 7 | $font-size-base : 14px; 8 | $font-size-small : 12px; 9 | $font-size-large : 16px; 10 | $line-height-base : 1.5; 11 | 12 | $dark-bg: #252a2f; 13 | $dark-bg-light: rgb(0, 33, 64); 14 | $dark-bg-dark: rgb(0, 12, 23); 15 | $dark-color: rgba(255, 255, 255, 0.8); 16 | $dark-selected-bg: rgb(24, 144, 255); 17 | $dark-selected-color: #ffffff; 18 | 19 | // Shadow 20 | $shadow-color : rgba(0, 0, 0, .2); 21 | $shadow-base : -1px 0 6px $shadow-color; 22 | $shadow-card : 0 1px 1px 0 rgba(0,0,0,.1); 23 | $shadow-up : 0 -1px 6px $shadow-color; 24 | $shadow-down : 0 1px 6px $shadow-color; 25 | $shadow-left : -1px 0 6px $shadow-color; 26 | $shadow-right : 1px 0 6px $shadow-color; 27 | $shadow-inset : inset 0 0 5px $shadow-color; -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | fiflow-io 7 | com.github.lessonone 8 | 1.10-SNAPSHOT 9 | 10 | 11 | 4.0.0 12 | fiflow-elasticsearch7 13 | 14 | 15 | 16 | 17 | org.elasticsearch.client 18 | elasticsearch-rest-high-level-client 19 | 7.6.1 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /fiflow-core/src/main/resources/demo-kafka.txt: -------------------------------------------------------------------------------- 1 | jar mysql,flink-jdbc,flink-json,kafka; 2 | 3 | CREATE TABLE student ( 4 | name VARCHAR, 5 | age INT, 6 | class VARCHAR 7 | ) WITH ( 8 | 'connector.type' = 'kafka', 9 | 'connector.version' = 'universal', 10 | 'connector.topic' = 'student', 11 | 'connector.startup-mode' = 'group-offsets', 12 | 'connector.properties.zookeeper.connect' = '127.0.0.1:2181', 13 | 'connector.properties.bootstrap.servers' = '127.0.0.1:9092', 14 | 'connector.properties.group.id' = 'kafka-mysql', 15 | 'format.type' = 'json', 16 | 'format.derive-schema' = 'true' 17 | ); 18 | 19 | CREATE TABLE stuout ( 20 | name VARCHAR, 21 | age INT, 22 | class VARCHAR 23 | ) WITH ( 24 | 'connector.type' = 'jdbc', 25 | 'connector.url' = 'jdbc:mysql://127.0.0.1:3306/flink', 26 | 'connector.table' = 'stuout', 27 | 'connector.username' = 'root', 28 | 'connector.password' = 'root', 29 | 'connector.write.flush.max-rows' = '500', 30 | 'connector.write.flush.interval' = '300' 31 | ); 32 | 33 | insert into stuout(name,age,class) 34 | select name, age, class from student where age > 16 ; -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/flink/BuildLevel.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.flink; 2 | 3 | /** 4 | * 构建级别 5 | * 1. help list tables 之类的无需执行 6 | * 2. select 需要特别处理 后 execute 7 | * 3. insert 可以直接提交执行 8 | */ 9 | public enum BuildLevel { 10 | None(0), // 啥也没干 11 | Show(1), // help, show tables 之类的无需执行 只要给出信息 12 | Set(2), // 设置 jar 并发 等 13 | 14 | Create(3), // create table 15 | Select(4), // select 16 | Insert(5), // insert 17 | 18 | Error(11); // 错误 19 | 20 | public final Integer level; 21 | 22 | BuildLevel(Integer level) { 23 | this.level = level; 24 | } 25 | 26 | public static BuildLevel parse(String name) { 27 | for (BuildLevel v : values()) { 28 | if (v.name().equalsIgnoreCase(name)) return v; 29 | } 30 | return null; 31 | } 32 | 33 | public boolean isNeedExecute() { 34 | if (this == BuildLevel.Select || this == BuildLevel.Insert) { 35 | return true; 36 | } 37 | return false; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return name(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/frame/FlinkBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.frame; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * flink xx 选择flink集群 12 | */ 13 | public class FlinkBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "-*\\s?flink\\s+(.*)"; 15 | 16 | public FlinkBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "flink xx; select flink cluster"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Set; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/util/JarUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.util; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.net.URL; 6 | import java.util.ArrayList; 7 | import java.util.HashSet; 8 | import java.util.List; 9 | import java.util.Set; 10 | 11 | public class JarUtils { 12 | 13 | 14 | public static List jars(String... jars) throws IOException { 15 | List result = new ArrayList<>(); 16 | if (jars == null || jars.length < 1) 17 | return result; 18 | 19 | Set sets = new HashSet<>(); 20 | 21 | String[] cps = System.getProperty("java.class.path").split(":"); 22 | for (String name : cps) { 23 | for (String t : jars) { 24 | if (name.contains(t.toLowerCase().trim())) { 25 | if (!sets.contains(name)) { 26 | result.add(new File(name).toURI().toURL()); 27 | sets.add(name); 28 | break; 29 | } 30 | } 31 | } 32 | } 33 | 34 | return result; 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d0c4313.90d5ee0f.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c4313"],{"3a7f":function(e,n,s){"use strict";s.r(n),s.d(n,"conf",(function(){return o})),s.d(n,"language",(function(){return t}));var o={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},t={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}}}]); 2 | //# sourceMappingURL=chunk-2d0c4313.90d5ee0f.js.map -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/AlterDatabaseBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | 9 | /** 10 | * alter database 11 | */ 12 | public class AlterDatabaseBuilder extends CmdBaseBuilder implements CmdBuilder { 13 | public static final String pattern = "(ALTER\\s+DATABASE\\s+.*)"; 14 | 15 | public AlterDatabaseBuilder() { 16 | super(pattern); 17 | } 18 | 19 | @Override 20 | public String help() { 21 | return "alter database xx; alter database xxx"; 22 | } 23 | 24 | @Override 25 | public BuildLevel buildLevel() { 26 | return BuildLevel.Create; 27 | } 28 | 29 | @Override 30 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 31 | String sql = cmd.args[0]; 32 | session.tEnv.sqlUpdate(sql); 33 | return result; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/vs/basic-languages/xml/xml.contribution.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "../_.contribution"], function (require, exports, __contribution_1) { 2 | /*--------------------------------------------------------------------------------------------- 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * Licensed under the MIT License. See License.txt in the project root for license information. 5 | *--------------------------------------------------------------------------------------------*/ 6 | 'use strict'; 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | __contribution_1.registerLanguage({ 9 | id: 'xml', 10 | extensions: ['.xml', '.dtd', '.ascx', '.csproj', '.config', '.wxi', '.wxl', '.wxs', '.xaml', '.svg', '.svgz', '.opf', '.xsl'], 11 | firstLine: '(\\<\\?xml.*)|(\\ 2 | 5 | 6 | fiflow 7 | com.github.lessonone 8 | 1.10-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | fiflow-api 13 | 14 | 15 | 16 | com.github.lessonone 17 | fiflow-core 18 | 1.10-SNAPSHOT 19 | 20 | 21 | 22 | com.github.lessonone 23 | fiflow-runtime 24 | 1.10-SNAPSHOT 25 | 26 | 27 | 28 | com.github.lessonone 29 | fiflow-elasticsearch7 30 | 1.10-SNAPSHOT 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/DropViewBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | 9 | /** 10 | * drop view xx 11 | */ 12 | public class DropViewBuilder extends CmdBaseBuilder implements CmdBuilder { 13 | public static final String pattern = "DROP\\s+VIEW\\s+(.*)"; 14 | 15 | public DropViewBuilder() { 16 | super(pattern); 17 | } 18 | 19 | @Override 20 | public String help() { 21 | return "drop view xx; drop view xx"; 22 | } 23 | 24 | @Override 25 | public BuildLevel buildLevel() { 26 | return BuildLevel.Create; 27 | } 28 | 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext sessionContext) { 32 | String name = cmd.args[0]; 33 | sessionContext.tEnv.dropTemporaryView(name); 34 | 35 | result.addMsg("drop view " + name); 36 | 37 | return result; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/flink/FlinkClusterInfo.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.flink; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * flink 集群信息 7 | */ 8 | public class FlinkClusterInfo implements Serializable { 9 | // 用户自定义的唯一名称方便使用 10 | private String code; 11 | 12 | private String host = "127.0.0.1"; 13 | 14 | private Integer port = 8081; 15 | 16 | // 集群模式 17 | private ClusterMode mode = ClusterMode.yarn; 18 | 19 | public String getCode() { 20 | return code; 21 | } 22 | 23 | public FlinkClusterInfo setCode(String code) { 24 | this.code = code; 25 | return this; 26 | } 27 | 28 | public String getHost() { 29 | return host; 30 | } 31 | 32 | public FlinkClusterInfo setHost(String host) { 33 | this.host = host; 34 | return this; 35 | } 36 | 37 | public Integer getPort() { 38 | return port; 39 | } 40 | 41 | public FlinkClusterInfo setPort(Integer port) { 42 | this.port = port; 43 | return this; 44 | } 45 | 46 | public ClusterMode getMode() { 47 | return mode; 48 | } 49 | 50 | public FlinkClusterInfo setMode(ClusterMode mode) { 51 | this.mode = mode; 52 | return this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/demo/DemoBase.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.demo; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | public abstract class DemoBase extends CmdBaseBuilder implements CmdBuilder { 11 | private String name; 12 | 13 | public DemoBase(String name) { 14 | super("demo\\s+" + name + "\\s?"); 15 | this.name = name; 16 | } 17 | 18 | @Override 19 | public BuildLevel buildLevel() { 20 | return BuildLevel.Show; 21 | } 22 | 23 | protected abstract String demoFileName(); 24 | 25 | @Override 26 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 27 | result.table().addHeads("demo " + name); 28 | try { 29 | result.table().addRow(readText(demoFileName())); 30 | } catch (Exception e) { 31 | result.addMsg(e.getMessage()); 32 | } 33 | return result; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /fiflow-io/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | fiflow 7 | com.github.lessonone 8 | 1.10-SNAPSHOT 9 | 10 | 4.0.0 11 | fiflow-io 12 | pom 13 | 1.10-SNAPSHOT 14 | 15 | 16 | fiflow-elasticsearch7 17 | fiflow-mysql-binlog 18 | 19 | 20 | 21 | 22 | com.github.lessonone 23 | fiflow-core 24 | 1.10-SNAPSHOT 25 | provided 26 | 27 | 28 | 29 | com.github.lessonone 30 | fiflow-runtime 31 | 1.10-SNAPSHOT 32 | provided 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/CreateTableBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.util.SqlSplitUtil; 9 | 10 | /** 11 | * create table t1( ) with ( ) 12 | */ 13 | public class CreateTableBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "(CREATE\\s+TABLE\\s+.*)"; 15 | 16 | public CreateTableBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "create table; table schema and connect info"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Create; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext sessionContext) { 32 | String sql = cmd.args[0]; 33 | sessionContext.tEnv.sqlUpdate(sql); 34 | result.addMsg("create table " + SqlSplitUtil.getCreateTableName(sql) + " ok"); 35 | return result; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/UseCatalogBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * use catalog xx 12 | */ 13 | public class UseCatalogBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "USE\\s+CATALOG\\s+(.*)"; 15 | 16 | public UseCatalogBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "use catalog xx; The name of the catalog to set as the current default catalog"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Set; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | final String catalog = cmd.args[0]; 33 | result.addMsg("use catalog " + catalog); 34 | session.tEnv.useCatalog(catalog); 35 | return result; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/InsertOverwriteBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.util.SqlSplitUtil; 9 | 10 | /** 11 | * insert overwrite 12 | */ 13 | public class InsertOverwriteBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "(INSERT\\s+OVERWRITE.*)"; 15 | 16 | public InsertOverwriteBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "insert overwrite; insert overwrite ..."; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Insert; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext sessionContext) { 32 | final String sql = cmd.args[0]; 33 | InsertIntoBuilder.insert(sql, sessionContext); 34 | result.addMsg("prepare insert overwrite " + SqlSplitUtil.getInsertIntoTableName(sql)); 35 | return result; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/ShowCatalogsBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * show catalogs 12 | */ 13 | public class ShowCatalogsBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "SHOW\\s+CATALOGS"; 15 | 16 | public ShowCatalogsBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "show catalogs; gets the names of all catalogs registered in this environment"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Show; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | result.table().addHeads("catalogs"); 33 | for (String t : session.tEnv.listCatalogs()) { 34 | result.table().addRow(t); 35 | } 36 | return result; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/ShowModulesBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * show modules 12 | */ 13 | public class ShowModulesBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "SHOW\\s+MODULES"; 15 | 16 | public ShowModulesBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "show modules; gets an array of names of all modules in this environment in the loaded order"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Show; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | result.table().addHeads("module name"); 33 | for (String t : session.tEnv.listModules()) { 34 | result.table().addRow(t); 35 | } 36 | return result; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/ShowDatabasesBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * show databases 12 | */ 13 | public class ShowDatabasesBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "SHOW\\s+DATABASES"; 15 | 16 | public ShowDatabasesBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "show databases; gets the names of all databases registered in the current catalog"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Show; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | result.table().addHeads("database name"); 33 | for (String t : session.tEnv.listDatabases()) { 34 | result.table().addRow(t); 35 | } 36 | return result; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/ShowTablesBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * show tables 12 | */ 13 | public class ShowTablesBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "SHOW\\s+TABLES"; 15 | 16 | public ShowTablesBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "show tables; list tables"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Show; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | result.table().addHeads("tables_in " + session.tEnv.getCurrentCatalog() + "." + session.tEnv.getCurrentDatabase()); 33 | 34 | for (String t : session.tEnv.listTables()) { 35 | result.table().addRow(t); 36 | } 37 | return result; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /fiflow-web/src/main/java/com/github/lessonone/fiflow/web/controller/FiflowSqlController.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.web.controller; 2 | 3 | 4 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 5 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 6 | import com.github.lessonone.fiflow.web.model.SqlCmd; 7 | import com.github.lessonone.fiflow.web.service.FiflowSqlService; 8 | import org.apache.commons.lang3.exception.ExceptionUtils; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | /** 16 | * 使用 fiflow 在 flink 中 执行 sql 17 | */ 18 | @RestController 19 | @RequestMapping("/fisql") 20 | public class FiflowSqlController { 21 | @Autowired 22 | private FiflowSqlService fiflowSqlService; 23 | 24 | @PostMapping("/run") 25 | public FlinkBuildInfo runSql(@RequestBody SqlCmd sqlCmd) { 26 | try { 27 | return fiflowSqlService.run(sqlCmd); 28 | } catch (Exception e) { 29 | e.printStackTrace(); 30 | FlinkBuildInfo result = new FlinkBuildInfo(BuildLevel.Error); 31 | result.addMsg(ExceptionUtils.getStackTrace(e)); 32 | return result; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/pojo/TableRow.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.pojo; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | 5 | import java.io.Serializable; 6 | import java.util.ArrayList; 7 | import java.util.Iterator; 8 | 9 | /** 10 | * 表格的一行数据 11 | */ 12 | public class TableRow extends ArrayList implements Serializable { 13 | 14 | public TableRow(int initialCapacity) { 15 | super(initialCapacity); 16 | } 17 | 18 | public TableRow() { 19 | } 20 | 21 | public static TableRow empty() { 22 | return new TableRow(); 23 | } 24 | 25 | public static TableRow empty(int size) { 26 | return new TableRow(size); 27 | } 28 | 29 | public static TableRow of(Object... values) { 30 | TableRow row = new TableRow(values.length); 31 | for (Object v : values) { 32 | row.add(v); 33 | } 34 | return row; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | Iterator it = iterator(); 40 | if (!it.hasNext()) 41 | return StringUtils.EMPTY; 42 | 43 | StringBuilder sb = new StringBuilder(); 44 | for (; ; ) { 45 | Object e = it.next(); 46 | sb.append(e); 47 | if (!it.hasNext()) { 48 | return sb.toString(); 49 | } 50 | sb.append(',').append(' '); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/java/com/github/lessonone/fiflow/io/elasticsearch7/demo/DemoSource.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.io.elasticsearch7.demo; 2 | 3 | import com.github.lessonone.fiflow.core.util.FlinkUtils; 4 | import com.github.lessonone.fiflow.io.elasticsearch7.ES; 5 | import com.github.lessonone.fiflow.io.elasticsearch7.core.ESOptions; 6 | import org.apache.flink.table.api.DataTypes; 7 | import org.apache.flink.table.api.Table; 8 | import org.apache.flink.table.descriptors.Schema; 9 | 10 | /** 11 | * 从 elasticsearch 中读取数据 谓词下推 12 | */ 13 | public class DemoSource extends DemoBase { 14 | 15 | public static void main(String[] args) throws Exception { 16 | ESOptions esOptions = ESOptions.builder() 17 | .setHosts("127.0.0.1:9200") 18 | .setIndex("student") 19 | .build(); 20 | 21 | Schema tableSchema = new Schema() 22 | .field("name", DataTypes.STRING()) 23 | .field("age", DataTypes.INT()) 24 | .field("class", DataTypes.STRING()); 25 | 26 | tEnv.connect(new ES() 27 | .setEsOptions(esOptions)) 28 | .withSchema(tableSchema) 29 | .createTemporaryTable("student"); 30 | 31 | Table table = tEnv.sqlQuery("select name, age, class from student where age >= 5"); 32 | 33 | FlinkUtils.collect(table); 34 | 35 | tEnv.execute("haha-job"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d2300d2.98d1e2fc.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/views/config/index.vue?2238","webpack:///./src/views/config/index.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","staticStyle","_v","_s","$route","meta","title","staticRenderFns","script","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,MAAM,CAACG,YAAY,CAAC,OAAS,MAAM,cAAc,SAAS,CAACP,EAAIQ,GAAG,IAAIR,EAAIS,GAAGR,KAAKS,OAAOC,KAAKC,OAAO,OAAOR,EAAG,gBAAgB,IAClQS,EAAkB,G,YCAlBC,EAAS,GAKTC,EAAY,eACdD,EACAf,EACAc,GACA,EACA,KACA,KACA,MAIa,aAAAE,E","file":"static/js/chunk-2d2300d2.98d1e2fc.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container\"},[_c('div',{staticStyle:{\"margin\":\"7px\",\"font-weight\":\"bold\"}},[_vm._v(\" \"+_vm._s(this.$route.meta.title)+\" \")]),_c('router-view')],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=9935d2a4&\"\nvar script = {}\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""} -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/CreateViewBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import org.apache.flink.table.api.Table; 9 | 10 | /** 11 | * create view 12 | */ 13 | public class CreateViewBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "CREATE\\s+VIEW\\s+(\\S+)\\s+AS\\s+(.*)"; 15 | 16 | public CreateViewBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "create view; create view xx as select ..."; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Create; 28 | } 29 | 30 | 31 | @Override 32 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext sessionContext) { 33 | String name = cmd.args[0]; 34 | String sql = cmd.args[1]; 35 | Table table = sessionContext.tEnv.sqlQuery(sql); 36 | sessionContext.tEnv.createTemporaryView(name, table); 37 | result.addMsg("create view " + name + " ok "); 38 | return result; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /fiflow-runtime/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | fiflow 7 | com.github.lessonone 8 | 1.10-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | fiflow-runtime 13 | 14 | 15 | 16 | com.github.lessonone 17 | fiflow-core 18 | 1.10-SNAPSHOT 19 | 20 | 21 | 22 | org.apache.flink 23 | flink-jdbc_2.11 24 | ${flink.version} 25 | 26 | 27 | 28 | org.apache.flink 29 | flink-connector-kafka_${scala.binary.version} 30 | ${flink.version} 31 | 32 | 33 | 34 | org.apache.flink 35 | flink-json 36 | ${flink.version} 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /fiflow-ui/src/utils/ajax.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import { Message } from 'element-ui' 3 | 4 | 5 | const instance = axios.create({ 6 | baseURL: '/fiflow', 7 | timeout: 30000, 8 | withCredentials: true, 9 | headers: { 'Content-Type': 'application/json;charset=UTF-8' }, 10 | }) 11 | 12 | instance.interceptors.request.use(config => { 13 | // 这里先不处理 14 | return config 15 | }) 16 | 17 | // respponse 拦截器 18 | instance.interceptors.response.use( 19 | response => { 20 | const status = response.status 21 | if (status != 200) { 22 | return Promise.reject(response.msg) 23 | } 24 | return response.data 25 | }, 26 | error => { 27 | let message = error.message 28 | Message.error({ message: message || '后台接口异常,请联系开发处理!' }) 29 | } 30 | ) 31 | 32 | const ajax = { 33 | // get请求 34 | get (url, params) { 35 | const json = { 36 | url: url, 37 | method: 'get' 38 | } 39 | if (params) { 40 | json.params = params 41 | } 42 | return instance(json) 43 | }, 44 | // post 请求 45 | post (url, params) { 46 | return instance.post(url, params) 47 | }, 48 | delete (url, params) { 49 | const json = { 50 | url: url, 51 | method: 'delete' 52 | } 53 | if (params) { 54 | json.params = params 55 | } 56 | return instance(json) 57 | } 58 | } 59 | 60 | export default ajax 61 | 62 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d209408.1336e8ff.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d209408"],{a7ea:function(t,r,e){"use strict";e.r(r),e.d(r,"conf",(function(){return s})),e.d(r,"language",(function(){return n}));var s={brackets:[],autoClosingPairs:[],surroundingPairs:[]},n={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=> accept(String sql); 23 | 24 | /** 25 | * 构建级别 26 | * 27 | * @return 28 | */ 29 | BuildLevel buildLevel(); 30 | 31 | 32 | /** 33 | * 先预处理一下 34 | * 35 | * @param cmd 36 | * @param sqlBuilder 37 | */ 38 | default void preBuild(Cmd cmd, SqlBuilder sqlBuilder) { 39 | 40 | } 41 | 42 | /** 43 | * 构建 把 sql 转换为 flink 中的操作 44 | * 45 | * @param cmd 46 | * @param sessionContext 47 | * @return 48 | */ 49 | FlinkBuildInfo build(Cmd cmd, SqlSessionContext sessionContext); 50 | 51 | /** 52 | * 帮助信息 53 | * 54 | * @return 使用;分隔为两部分 55 | */ 56 | default String help() { 57 | String name = this.getClass().getSimpleName() 58 | .replace("Builder", "") 59 | .toLowerCase(); 60 | 61 | 62 | return name + "; todo"; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/ExplainBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | import org.apache.flink.table.api.Table; 10 | 11 | /** 12 | * explain xx 13 | */ 14 | public class ExplainBuilder extends CmdBaseBuilder implements CmdBuilder { 15 | public static final String pattern = "EXPLAIN\\s+(.*)"; 16 | 17 | public ExplainBuilder() { 18 | super(pattern); 19 | } 20 | 21 | @Override 22 | public String help() { 23 | return "explain; the AST and SQL queries and the execution plan to compute"; 24 | } 25 | 26 | @Override 27 | public BuildLevel buildLevel() { 28 | return BuildLevel.Show; 29 | } 30 | 31 | @Override 32 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 33 | final String sql = cmd.args[0]; 34 | result.table().addHeads("AST and execution plan"); 35 | 36 | Table table = session.tEnv.sqlQuery(sql); 37 | String msg = session.tEnv.explain(table); 38 | result.table().addRow(msg); 39 | return result; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/stream/Link.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.stream; 2 | 3 | import org.apache.commons.lang3.builder.EqualsBuilder; 4 | import org.apache.commons.lang3.builder.HashCodeBuilder; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 节点之间的连线 10 | */ 11 | public class Link implements Serializable { 12 | // 源节点id 13 | private String source; 14 | // 目标节点id 15 | private String target; 16 | // todo 属性 17 | 18 | 19 | public String getSource() { 20 | return source; 21 | } 22 | 23 | public Link setSource(String source) { 24 | this.source = source; 25 | return this; 26 | } 27 | 28 | public String getTarget() { 29 | return target; 30 | } 31 | 32 | public Link setTarget(String target) { 33 | this.target = target; 34 | return this; 35 | } 36 | 37 | @Override 38 | public boolean equals(Object o) { 39 | if (this == o) return true; 40 | 41 | if (o == null || getClass() != o.getClass()) return false; 42 | 43 | Link connect = (Link) o; 44 | 45 | return new EqualsBuilder() 46 | .append(source, connect.source) 47 | .append(target, connect.target) 48 | .isEquals(); 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | return new HashCodeBuilder(17, 37) 54 | .append(source) 55 | .append(target) 56 | .toHashCode(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/frame/SetBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.frame; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * set a = 1 12 | */ 13 | public class SetBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "SET(\\s+(\\S+)\\s*=(.*))?"; 15 | 16 | public SetBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "se k = v; set configuration"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Set; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | if (cmd.args.length != 3) { 33 | result.addMsg("illegal set " + cmd.args[0]); 34 | } else { 35 | String k = cmd.args[1]; 36 | String v = cmd.args[2]; 37 | 38 | result.addMsg("set configuration " + k + "=" + v); 39 | session.tEnv.getConfig().getConfiguration().setString(k, v); 40 | } 41 | return result; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /fiflow-ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fiflow-ui", 3 | "version": "0.1.0", 4 | "private": false, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.19.2", 12 | "core-js": "^3.6.4", 13 | "element-ui": "^2.13.0", 14 | "lodash": "^4.17.15", 15 | "monaco-editor": "^0.20.0", 16 | "vue": "^2.6.11", 17 | "vue-router": "^3.1.6", 18 | "vuescroll": "^4.15.0" 19 | }, 20 | "devDependencies": { 21 | "@vue/cli-plugin-babel": "^4.2.0", 22 | "@vue/cli-plugin-eslint": "^4.2.0", 23 | "@vue/cli-service": "^4.2.0", 24 | "babel-eslint": "^10.0.3", 25 | "copy-webpack-plugin": "^5.1.1", 26 | "eslint": "^6.7.2", 27 | "eslint-plugin-vue": "^6.1.2", 28 | "filemanager-webpack-plugin": "^2.0.5", 29 | "node-sass": "^4.13.1", 30 | "sass-loader": "^8.0.2", 31 | "vue-template-compiler": "^2.6.11" 32 | }, 33 | "eslintConfig": { 34 | "root": true, 35 | "env": { 36 | "node": true 37 | }, 38 | "extends": [ 39 | "plugin:vue/essential", 40 | "eslint:recommended" 41 | ], 42 | "parserOptions": { 43 | "parser": "babel-eslint" 44 | }, 45 | "rules": {} 46 | }, 47 | "browserslist": [ 48 | "> 1%", 49 | "last 2 versions" 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/frame/ParallelismBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.frame; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | import org.apache.flink.table.api.config.ExecutionConfigOptions; 10 | 11 | /** 12 | * -p n 13 | * 设置任务的并发度 14 | */ 15 | public class ParallelismBuilder extends CmdBaseBuilder implements CmdBuilder { 16 | public static final String pattern = "-*\\s?-p\\s+(\\d)"; 17 | 18 | public ParallelismBuilder() { 19 | super(pattern); 20 | } 21 | 22 | @Override 23 | public String help() { 24 | return "-p n; set job parallelism"; 25 | } 26 | 27 | @Override 28 | public BuildLevel buildLevel() { 29 | return BuildLevel.Set; 30 | } 31 | 32 | @Override 33 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 34 | String p = cmd.args[0]; 35 | result.addMsg("set parallelism " + p); 36 | Integer pp = Integer.parseInt(p); 37 | 38 | session.tEnv.getConfig().getConfiguration() 39 | .set(ExecutionConfigOptions.TABLE_EXEC_RESOURCE_DEFAULT_PARALLELISM, pp); 40 | 41 | return result; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/core/FiflowSession.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.core; 2 | 3 | import com.github.lessonone.fiflow.core.frame.SessionConfig; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.concurrent.atomic.AtomicInteger; 8 | 9 | /** 10 | * 核心 入口 11 | */ 12 | public abstract class FiflowSession { 13 | public final String id; 14 | public final SessionConfig sessionConfig; 15 | public volatile Boolean closed = false; 16 | private List contextList = new ArrayList<>(); 17 | 18 | private AtomicInteger step = new AtomicInteger(0); 19 | 20 | public FiflowSession(String id, SessionConfig sessionConfig) { 21 | this.id = id; 22 | if (sessionConfig == null) { 23 | sessionConfig = new SessionConfig(); 24 | } 25 | this.sessionConfig = sessionConfig; 26 | } 27 | 28 | /** 29 | * context build 成功后 才加入到 session 中 30 | * 31 | * @param conetxt 32 | * @return 33 | */ 34 | public FiflowSession addContext(T conetxt) { 35 | this.contextList.add(conetxt); 36 | return this; 37 | } 38 | 39 | public List getContextList() { 40 | return contextList; 41 | } 42 | 43 | public String incrementAndGetContextId() { 44 | return this.id + "-" + step.incrementAndGet(); 45 | } 46 | 47 | /** 48 | * 关闭该 session 49 | */ 50 | public synchronized void close() { 51 | this.closed = true; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/ShowFunctionsBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * show functions 12 | */ 13 | public class ShowFunctionsBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "SHOW\\s+FUNCTIONS"; 15 | 16 | public ShowFunctionsBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "show functions; gets the names of all functions in this environment"; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Show; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | result.table().addHeads("functions", "is user defined "); 33 | for (String t : session.tEnv.listFunctions()) { 34 | result.table().addRow(t, "false"); 35 | } 36 | for (String t : session.tEnv.listUserDefinedFunctions()) { 37 | result.table().addRow(t, "true"); 38 | } 39 | return result; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/InsertIntoBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.util.SqlSplitUtil; 9 | 10 | /** 11 | * insert into t1(f1,f2,...) select f1, f2, ... from t2 where ... 12 | * 数据插入语句 13 | */ 14 | public class InsertIntoBuilder extends CmdBaseBuilder implements CmdBuilder { 15 | public static final String pattern = "(INSERT\\s+INTO.*)"; 16 | 17 | public InsertIntoBuilder() { 18 | super(pattern); 19 | } 20 | 21 | public static void insert(String sql, SqlSessionContext sessionContext) { 22 | sessionContext.tEnv.sqlUpdate(sql); 23 | } 24 | 25 | @Override 26 | public String help() { 27 | return "insert into; write data and trigger job submit"; 28 | } 29 | 30 | @Override 31 | public BuildLevel buildLevel() { 32 | return BuildLevel.Insert; 33 | } 34 | 35 | @Override 36 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext sessionContext) { 37 | final String sql = cmd.args[0]; 38 | insert(sql, sessionContext); 39 | result.addMsg("prepare insert into " + SqlSplitUtil.getInsertIntoTableName(sql)); 40 | return result; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/SelectBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.util.FlinkUtils; 9 | import org.apache.flink.table.api.Table; 10 | 11 | /** 12 | * select 数据查询 13 | */ 14 | public class SelectBuilder extends CmdBaseBuilder implements CmdBuilder { 15 | public static final String pattern = "(SELECT.*)"; 16 | 17 | public SelectBuilder() { 18 | super(pattern); 19 | } 20 | 21 | @Override 22 | public String help() { 23 | return "select ; query data and trigger job submit busy doing"; 24 | } 25 | 26 | @Override 27 | public BuildLevel buildLevel() { 28 | return BuildLevel.Select; 29 | } 30 | 31 | @Override 32 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext sessionContext) { 33 | final String sql = cmd.args[0]; 34 | Table table = sessionContext.tEnv.sqlQuery(sql); 35 | 36 | try { 37 | FlinkUtils.collect(table); 38 | } catch (Exception e) { 39 | e.printStackTrace(); 40 | } 41 | 42 | // SocketClientSink 43 | // CollectSink 44 | 45 | 46 | return result; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /fiflow-core/src/main/java/com/github/lessonone/fiflow/core/sql/builder/system/UseBuilder.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.core.sql.builder.system; 2 | 3 | import com.github.lessonone.fiflow.core.flink.BuildLevel; 4 | import com.github.lessonone.fiflow.core.flink.FlinkBuildInfo; 5 | import com.github.lessonone.fiflow.core.sql.Cmd; 6 | import com.github.lessonone.fiflow.core.sql.CmdBuilder; 7 | import com.github.lessonone.fiflow.core.sql.SqlSessionContext; 8 | import com.github.lessonone.fiflow.core.sql.builder.CmdBaseBuilder; 9 | 10 | /** 11 | * use xx 12 | */ 13 | public class UseBuilder extends CmdBaseBuilder implements CmdBuilder { 14 | public static final String pattern = "USE\\s+(?!CATALOG)(.*)"; 15 | 16 | public UseBuilder() { 17 | super(pattern); 18 | } 19 | 20 | @Override 21 | public String help() { 22 | return "use xx; use database "; 23 | } 24 | 25 | @Override 26 | public BuildLevel buildLevel() { 27 | return BuildLevel.Set; 28 | } 29 | 30 | @Override 31 | public FlinkBuildInfo build(FlinkBuildInfo result, Cmd cmd, SqlSessionContext session) { 32 | String database = cmd.args[0]; 33 | 34 | boolean has = false; 35 | for (String t : session.tEnv.listDatabases()) { 36 | if (database.equalsIgnoreCase(t)) { 37 | has = true; 38 | } 39 | } 40 | 41 | if (has == false) 42 | throw new IllegalArgumentException("database not exist " + database); 43 | 44 | result.addMsg("use database " + database); 45 | 46 | return result; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/java/com/github/lessonone/fiflow/io/elasticsearch7/ES.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.io.elasticsearch7; 2 | 3 | import com.github.lessonone.fiflow.core.util.Preconditions; 4 | import com.github.lessonone.fiflow.io.elasticsearch7.core.ESOptions; 5 | import org.apache.flink.annotation.PublicEvolving; 6 | import org.apache.flink.table.descriptors.ConnectorDescriptor; 7 | import org.apache.flink.table.descriptors.DescriptorProperties; 8 | 9 | import java.util.Map; 10 | 11 | import static com.github.lessonone.fiflow.io.elasticsearch7.ESValidator.*; 12 | 13 | @PublicEvolving 14 | public class ES extends ConnectorDescriptor { 15 | private ESOptions esOptions; 16 | 17 | public ES() { 18 | super(CONNECTOR_TYPE_VALUE_ELASTICSEARCH, 1, false); 19 | } 20 | 21 | public ES setEsOptions(ESOptions esOptions) { 22 | this.esOptions = esOptions; 23 | return this; 24 | } 25 | 26 | @Override 27 | protected Map toConnectorProperties() { 28 | Preconditions.checkNotNull(esOptions, "esOption should supplied."); 29 | 30 | DescriptorProperties properties = new DescriptorProperties(); 31 | properties.putString(CONNECTOR_HOSTS, esOptions.getHosts()); 32 | properties.putString(CONNECTOR_INDEX, esOptions.getIndex()); 33 | 34 | if (esOptions.getUsername() != null && esOptions.getPassword() != null) { 35 | properties.putString(CONNECTOR_USERNAME, esOptions.getUsername()); 36 | properties.putString(CONNECTOR_PASSWORD, esOptions.getPassword()); 37 | } 38 | 39 | return properties.asMap(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/src/main/java/com/github/lessonone/fiflow/io/elasticsearch7/demo/DemoDDL.java: -------------------------------------------------------------------------------- 1 | package com.github.lessonone.fiflow.io.elasticsearch7.demo; 2 | 3 | /** 4 | * 从 mysql 中读取 数据表 student 存入 elasticsearch 的 stuout 索引中 5 | */ 6 | public class DemoDDL extends DemoBase { 7 | 8 | public static void main(String[] args) throws Exception { 9 | String sqlStudent = "CREATE TABLE student ( \n" + 10 | " name VARCHAR, \n" + 11 | " age INT, \n" + 12 | " class VARCHAR, \n" + 13 | " haha AS PROCTIME()\n" + 14 | " ) WITH ( \n" + 15 | " 'connector.type' = 'jdbc', \n" + 16 | " 'connector.url' = 'jdbc:mysql://127.0.0.1:3306/flink', \n" + 17 | " 'connector.table' = 'student', \n" + 18 | " 'connector.username' = 'root',\n" + 19 | " 'connector.password' = 'root'\n" + 20 | ")"; 21 | tEnv.sqlUpdate(sqlStudent); 22 | 23 | String sqlStuout = "CREATE TABLE stuout ( \n" + 24 | " name VARCHAR, \n" + 25 | " age INT, \n" + 26 | " class VARCHAR\n" + 27 | " ) WITH ( \n" + 28 | " 'connector.type' = 'elasticsearch', \n" + 29 | " 'connector.hosts' = '127.0.0.1:9200', \n" + 30 | " 'connector.index' = 'stuout' \n" + 31 | ")"; 32 | 33 | tEnv.sqlUpdate(sqlStuout); 34 | 35 | tEnv.sqlUpdate("insert into stuout(name,age,class) select name, age, class from student "); 36 | 37 | tEnv.execute("haha-job"); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /fiflow-ui/src/assets/styles/app.scss: -------------------------------------------------------------------------------- 1 | @import 'variables.scss'; 2 | @import 'normalize.css'; 3 | 4 | * { 5 | box-sizing: border-box; 6 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 7 | } 8 | 9 | *:before, 10 | *:after { 11 | box-sizing: border-box; 12 | } 13 | 14 | body{ 15 | font-family: $font-family; 16 | font-variant-numeric: tabular-nums; 17 | font-size: $font-size-base; 18 | color: $text-color; 19 | line-height: $line-height-base; 20 | background-color: $body-background; 21 | overflow: hidden; 22 | } 23 | .layout-content { 24 | height: 100%; 25 | } 26 | 27 | .layout-body{ 28 | width: 100%; 29 | height: 100%; 30 | padding: 40px 0 40px; 31 | } 32 | 33 | .ivu-message { 34 | z-index: 2000 !important; 35 | } 36 | 37 | 38 | @media (min-width: 768px){ 39 | .container { 40 | width: 768px; 41 | } 42 | } 43 | 44 | @media (min-width: 992px){ 45 | .container { 46 | width: 940px; 47 | } 48 | } 49 | 50 | @media (min-width: 1200px) { 51 | .container { 52 | width: 1140px; 53 | } 54 | } 55 | 56 | 57 | .container { 58 | margin-right: auto; 59 | margin-left: auto; 60 | padding-left: 0px; 61 | padding-right: 0px; 62 | } 63 | 64 | .inline-block{ 65 | display: inline-block; 66 | } 67 | 68 | 69 | /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ 70 | ::-webkit-scrollbar 71 | { 72 | width: 5px; 73 | height: 60px; 74 | background-color: #F5F5F5; 75 | } 76 | 77 | /*定义滚动条轨道 内阴影+圆角*/ 78 | ::-webkit-scrollbar-track 79 | { 80 | border-radius: 5px; 81 | background-color: #F5F5F5; 82 | } 83 | 84 | /*定义滑块 内阴影+圆角*/ 85 | ::-webkit-scrollbar-thumb 86 | { 87 | border-radius: 5px; 88 | height: 60px; 89 | background-color: #555; 90 | } -------------------------------------------------------------------------------- /fiflow-io/fiflow-elasticsearch7/README.md: -------------------------------------------------------------------------------- 1 | # Elasticsearch7 source and sink 2 | 3 | support elasticsearch version 7.x 4 | 5 | ## source 6 | - 按 shard 分片读取数据 7 | - 支持谓词下推 8 | - 支持异步纬表join 9 | 10 | ## sink 11 | - 支持 append 和 retract 模式 12 | 13 | ## 如何使用 14 | 15 | ``` 16 | 17 | com.github.lessonone 18 | fiflow-elasticsearch7 19 | 1.10-SNAPSHOT 20 | 21 | ``` 22 | 23 | 示例 demo代码: 24 | - DemoSource.java 25 | - DemoDDL.java 26 | - DemoStream.java 27 | 28 | 29 | ### ddl 方式 30 | ``` 31 | CREATE TABLE stuout ( 32 | name VARCHAR, 33 | age INT, 34 | class VARCHAR 35 | ) WITH ( 36 | 'connector.type' = 'elasticsearch', 37 | 'connector.hosts' = '127.0.0.1:9200', 38 | 'connector.index' = 'stuout' 39 | ) 40 | ``` 41 | 42 | ### connector 方式 43 | ``` 44 | ESOptions esOptions = ESOptions.builder() 45 | .setHosts("127.0.0.1:9200") 46 | .setIndex("student") 47 | .build(); 48 | 49 | Schema tableSchema = new Schema() 50 | .field("name", DataTypes.STRING()) 51 | .field("age", DataTypes.INT()) 52 | .field("class", DataTypes.STRING()); 53 | 54 | tEnv.connect(new ES() 55 | .setEsOptions(esOptions)) 56 | .withSchema(tableSchema) 57 | .createTemporaryTable("student"); 58 | ``` 59 | 60 | ### stream api 61 | ``` 62 | // source function 63 | ESSourceFunction sourceFunction = ESSourceFunction.builder() 64 | .setEsOptions(es1) 65 | .setRowTypeInfo(tableSchema) 66 | .build(); 67 | 68 | // sink function 69 | ESSinkFunction sinkFunction = ESSinkFunction.builder() 70 | .setEsOptions(es2) 71 | .setRowTypeInfo(tableSchema) 72 | .build(); 73 | ``` -------------------------------------------------------------------------------- /fiflow-web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | fiflow 7 | com.github.lessonone 8 | 1.10-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | fiflow-web 13 | 14 | 15 | 2.1.6.RELEASE 16 | 17 | 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-dependencies 23 | ${spring.boot.version} 24 | pom 25 | import 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | io.vertx 34 | vertx-core 35 | 4.0.0-milestone4 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-web 41 | 42 | 43 | 44 | com.github.lessonone 45 | fiflow-api 46 | 1.10-SNAPSHOT 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /fiflow-web/src/main/resources/static/js/chunk-2d0d0645.1afee857.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d0645"],{"687d":function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return a})),n.d(t,"language",(function(){return o}));var a={comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}]},o={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[//,{token:"comment",next:"@pop"}],[/