summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig13
-rw-r--r--.gitignore35
-rw-r--r--pom.xml494
-rw-r--r--src/main/resources/log4j2.properties32
-rw-r--r--src/test/java/com/geedgenetworks/flink/easy/application/ApplicationTest.java33
-rw-r--r--src/test/resources/data/order-records.csv18
-rw-r--r--src/test/resources/data/user-records.csv4
-rw-r--r--src/test/resources/jobs/job1.yml50
-rw-r--r--src/test/resources/tools/nc.exebin0 -> 45272 bytes
9 files changed, 679 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..dc8496f
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,13 @@
+root = true
+
+[*]
+end_of_line = lf
+
+[java]
+charset = utf-8
+indent_size = 4
+indent_style = tab
+insert_final_newline = true
+max_line_length = 120
+tab_width = 2
+ij_continuation_indent_size = 2
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b425f09
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,35 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store \ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..0f683f6
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,494 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.geedgenetworks.flink.easy</groupId>
+ <artifactId>easy-application</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <java.version>11</java.version>
+ <maven.compiler.source>${java.version}</maven.compiler.source>
+ <maven.compiler.target>${java.version}</maven.compiler.target>
+ <scala.version>2.12.10</scala.version>
+ <scala.binary.version>2.12</scala.binary.version>
+ <flink.version>1.13.6</flink.version>
+
+ <easy.stream.version>1.4-rc5</easy.stream.version>
+
+ <slf4j.version>1.7.32</slf4j.version>
+ <log4j.version>2.17.1</log4j.version>
+ <junit.version>5.8.0</junit.version>
+ </properties>
+
+ <dependencies>
+ <!-- DEV -->
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
+ <version>4.4.2</version>
+ </dependency>
+
+ <!-- LOG -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+
+ <!-- Easy stream -->
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-flink-shim</artifactId>
+ </dependency>
+
+ <!-- Pipeline -->
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-grouped-exec-pipeline</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-filter-pipeline</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-console-pipeline</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-correlate-pipeline</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-multi-rule-pipeline</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-select-pipeline</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-flatmap-pipeline</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+
+ <!-- Connector -->
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-kafka-connector</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-socket-connector</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-text-connector</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-console-connector</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+
+ <!-- Format -->
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-json-format</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-csv-format</artifactId>
+ </dependency>
+
+ <!-- Flink -->
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-clients_${scala.binary.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-runtime_${scala.binary.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-runtime-web_${scala.binary.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-runtime-blink_${scala.binary.version}</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-cep_${scala.binary.version}</artifactId>
+ </dependency>
+
+ <!-- Test -->
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- DEV -->
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
+ <version>4.4.2</version>
+ </dependency>
+ <!-- LOG -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <!-- API bridge between log4j 1 and 2 -->
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-1.2-api</artifactId>
+ <version>${log4j.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Test -->
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Easy Stream-->
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-common</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-core</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-grouped-exec-pipeline</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-filter-pipeline</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-console-pipeline</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-kafka-connector</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-socket-connector</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-json-format</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-csv-format</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.geedgenetworks.flink</groupId>
+ <artifactId>easy-stream-flink-shim</artifactId>
+ <version>${easy.stream.version}</version>
+ </dependency>
+
+ <!-- Flink -->
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-core</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-clients_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-runtime_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-runtime-web_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-connector-kafka_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-json</artifactId>
+ <version>${flink.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-common</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-runtime-blink_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>flink-cep_${scala.binary.version}</artifactId>
+ <version>${flink.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>3.1.2</version>
+ <configuration>
+ <suppressionsLocation>${basedir}/dev/suppressions.xml</suppressionsLocation>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <configLocation>${basedir}/dev/checkstyle.xml</configLocation>
+ <logViolationsToConsole>true</logViolationsToConsole>
+ <failOnViolation>true</failOnViolation>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>com.puppycrawl.tools</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>8.40</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>java-style-check</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <sourceDirectories>src/main/java</sourceDirectories>
+ </configuration>
+ </execution>
+ <execution>
+ <id>java-test-style-check</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <testSourceDirectories>src/test/java</testSourceDirectories>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <version>4.4.2.2</version>
+ <configuration>
+ <xmlOutput>true</xmlOutput>
+ <!-- Low, Medium, High ('Low' is strictest) -->
+ <threshold>Low</threshold>
+ <effort>default</effort>
+ <spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
+ <excludeFilterFile>${basedir}/dev/spotbugs-exclude.xml</excludeFilterFile>
+ <failOnError>true</failOnError>
+ </configuration>
+ <executions>
+ <execution>
+ <id>findbugs-main</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>findbugs-test</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <includeTests>true</includeTests>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ <configuration>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>3.5.1</version>
+ <executions>
+ <execution>
+ <id>default-shade</id>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createDependencyReducedPom>false</createDependencyReducedPom>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <artifactSet>
+ <excludes>
+ <exclude>org.apache.flink:force-shading</exclude>
+ <exclude>com.google.code.findbugs:jsr305</exclude>
+ <exclude>org.slf4j:*</exclude>
+ <exclude>org.apache.logging.log4j:*</exclude>
+ <exclude>org.mockito:mockito-core</exclude>
+ </excludes>
+ </artifactSet>
+ <filters>
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/*.SF</exclude>
+ <exclude>META-INF/*.DSA</exclude>
+ <exclude>META-INF/*.RSA</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>3.1.2</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/src/main/resources/log4j2.properties b/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..d2455b2
--- /dev/null
+++ b/src/main/resources/log4j2.properties
@@ -0,0 +1,32 @@
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+rootLogger.level = ERROR
+rootLogger.appenderRefs = console
+rootLogger.appenderRef.console.ref = ConsoleAppender
+
+appender.console.name = ConsoleAppender
+appender.console.type = CONSOLE
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-20c %x - %m%n
+
+logger.easy.name = com.geedgenetworks.flink.easy
+logger.easy.level = DEBUG
+logger.easy.appenderRefs = console
+logger.easy.appenderRef.console.ref = ConsoleAppender
+logger.easy.additivity = false
diff --git a/src/test/java/com/geedgenetworks/flink/easy/application/ApplicationTest.java b/src/test/java/com/geedgenetworks/flink/easy/application/ApplicationTest.java
new file mode 100644
index 0000000..deb7693
--- /dev/null
+++ b/src/test/java/com/geedgenetworks/flink/easy/application/ApplicationTest.java
@@ -0,0 +1,33 @@
+package com.geedgenetworks.flink.easy.application;
+
+import com.geedgenetworks.flink.easy.core.Runners;
+import org.junit.jupiter.api.Test;
+
+public class ApplicationTest {
+
+ static {
+// System.setProperty("easy.execute.mode", "validate");
+ System.setProperty("flink.rest.bind-port", "8081");
+// System.setProperty("flink.rest.flamegraph.enabled", "true");
+ System.setProperty("flink.heartbeat.timeout", "1800000");
+ }
+
+ public static String discoverConfiguration(final String name) throws Exception {
+ var path = String.format("/jobs/%s.yml", name);
+ var resource = ApplicationTest.class.getResource(path);
+ if (resource == null) {
+ // maven
+ resource = ApplicationTest.class.getResource(String.format("../classes/%s", path));
+ }
+ if (resource == null) {
+ throw new IllegalArgumentException(
+ String.format("Not found job '%s' in path [%s].", name, path));
+ }
+ return resource.getPath();
+ }
+
+ @Test
+ public void testJob() throws Exception {
+ Runners.run(discoverConfiguration("job1"));
+ }
+}
diff --git a/src/test/resources/data/order-records.csv b/src/test/resources/data/order-records.csv
new file mode 100644
index 0000000..76e2cf2
--- /dev/null
+++ b/src/test/resources/data/order-records.csv
@@ -0,0 +1,18 @@
+1,Tom,apple,fruit,15.50,2020-01-01 09:10:05.451
+2,Tom,banana,fruit,12.50,2020-01-01 09:11:02.123
+3,Tom,carrot,vegetable,8.75,2020-01-01 09:34:23.498
+4,Tom,apple,fruit,15.50,2020-01-01 09:45:10.174
+5,John,chocolate,dessert,2400.00,2020-01-01 09:52:37.836
+6,Kevin,cake,dessert,129.00,2020-01-01 10:02:03.537
+7,Kevin,chocolate,dessert,99.00,2020-01-01 10:14:29.381
+8,Kevin,banana,fruit,19.50,2020-01-01 10:22:45.984
+9,Kevin,apple,fruit,15.50,2020-01-01 10:25:05.423
+10,Kevin,strawberry,fruit,8.75,2020-01-01 10:34:38.223
+15,Kevin,apple,fruit,25.50,2020-01-01 10:42:41.436
+11,Susan,chocolate,dessert,49.00,2020-01-01 10:47:31.250
+12,Susan,biscuit,dessert,88.00,2020-01-01 10:52:20.327
+13,Susan,banana,fruit,19.50,2020-01-01 10:52:25.285
+14,Susan,apple,fruit,15.50,2020-01-01 10:52:26.621
+18,Susan,apple,fruit,25.50,2020-01-01 10:52:33.001
+16,Susan,tomato,vegetable,25.50,2020-01-01 11:22:49.158
+17,Susan,beer,drink,39.90,2020-01-01 11:34:04.547 \ No newline at end of file
diff --git a/src/test/resources/data/user-records.csv b/src/test/resources/data/user-records.csv
new file mode 100644
index 0000000..c18de2b
--- /dev/null
+++ b/src/test/resources/data/user-records.csv
@@ -0,0 +1,4 @@
+Tom,true,1990-11-12
+John,false,1996-05-01
+Kevin,true,1988-02-02
+Susan,false,1970-04-13 \ No newline at end of file
diff --git a/src/test/resources/jobs/job1.yml b/src/test/resources/jobs/job1.yml
new file mode 100644
index 0000000..b73b376
--- /dev/null
+++ b/src/test/resources/jobs/job1.yml
@@ -0,0 +1,50 @@
+job:
+ name: A Stream Example
+ parallelism: 1
+ active-pipeline:
+# - stream1
+ - rule1-sink
+
+source:
+ - name: order-records
+ type: socket
+ option:
+ hostname: localhost
+ port: 9999
+ format: csv
+ schema:
+ - name: id # 订单号
+ data-type: BIGINT NOT NULL
+ - name: username # 用户名
+ data-type: STRING NOT NULL
+ - name: product_name # 商品名称
+ data-type: STRING NOT NULL
+ - name: product_type # 商品类型
+ data-type: STRING NOT NULL
+ - name: amount # 金额
+ data-type: DECIMAL(10, 2) NOT NULL
+ - name: formatted_timestamp
+ data-type: STRING NOT NULL
+ - name: event_timestamp
+ for: TO_TIMESTAMP_LTZ(UNIX_TIMESTAMP(formatted_timestamp, 'yyyy-MM-dd HH:mm:ss.SSS'), 3)
+ watermark: event_timestamp - INTERVAL '5' SECOND
+
+sink:
+ - name: rule1-sink
+ based-on: stream1.rule1
+ type: console
+ format: json
+
+pipeline:
+ - name: stream1
+ category: MULTI-RULE
+ based-on: order-records
+ rule:
+ - name: rule1 # 用于查找 在 1 分钟内购买了 3 次及以上,或金额总计大于 1000 的 用户
+ type: AGGREGATE
+# event-driven: true
+ aggregate: COUNT(1) as cnt, SUM(amount) as total_amount
+ group-by: username
+ having: cnt >= 3 || total_amount > 1000
+ with-in: 1 minute
+ slide-step: 10 second \ No newline at end of file
diff --git a/src/test/resources/tools/nc.exe b/src/test/resources/tools/nc.exe
new file mode 100644
index 0000000..79bc027
--- /dev/null
+++ b/src/test/resources/tools/nc.exe
Binary files differ