diff options
| author | 王宽 <[email protected]> | 2024-02-02 08:17:35 +0000 |
|---|---|---|
| committer | 王宽 <[email protected]> | 2024-02-02 08:17:35 +0000 |
| commit | 05b53e48d59f6bf1e0cd7c22f9a725bd4c89d857 (patch) | |
| tree | 46d18daed3ad4c78952ad7212fc2424c6c1705fc | |
| parent | 3810fc7dd1e3c2cf3831564d6ebc8cdfa2e156e2 (diff) | |
| parent | 08634fe0209d890a3d363cfc6c43e980fadf1a40 (diff) | |
Merge branch 'feature/cn' into 'develop'
[improve][examples] add CN example
See merge request galaxy/platform/groot-stream!18
16 files changed, 78 insertions, 4 deletions
diff --git a/groot-examples/cn-example/pom.xml b/groot-examples/cn-example/pom.xml new file mode 100644 index 0000000..4f15aa6 --- /dev/null +++ b/groot-examples/cn-example/pom.xml @@ -0,0 +1,15 @@ +<?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> + <parent> + <groupId>com.geedgenetworks</groupId> + <artifactId>groot-examples</artifactId> + <version>${revision}</version> + </parent> + + <artifactId>cn-example</artifactId> + <name>Groot : Examples : CN</name> + +</project>
\ No newline at end of file diff --git a/groot-examples/cn-example/src/main/java/com/geedgenetworks/example/CnExample.java b/groot-examples/cn-example/src/main/java/com/geedgenetworks/example/CnExample.java new file mode 100644 index 0000000..2bc91db --- /dev/null +++ b/groot-examples/cn-example/src/main/java/com/geedgenetworks/example/CnExample.java @@ -0,0 +1,40 @@ +package com.geedgenetworks.example; + +import com.geedgenetworks.bootstrap.command.ExecuteCommandArgs; +import com.geedgenetworks.bootstrap.enums.DeployMode; +import com.geedgenetworks.bootstrap.enums.TargetType; +import com.geedgenetworks.bootstrap.main.GrootStreamServer; + +import java.io.FileNotFoundException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Paths; + +/** + * @author gujinkai + * @version 1.0 + * @date 2024/2/2 14:33 + */ +public class CnExample { + + public static void main(String[] args) throws FileNotFoundException, URISyntaxException { + //System.setProperty("udf.config", ""); + String configPath = args.length > 0 ? args[0] : "/example/cn_grootstream_job_local_template.yaml"; + String configFile = getTestConfigFile(configPath); + ExecuteCommandArgs executeCommandArgs = new ExecuteCommandArgs(); + executeCommandArgs.setConfigFile(configFile); + executeCommandArgs.setCheckConfig(false); + executeCommandArgs.setDeployMode(DeployMode.RUN); + executeCommandArgs.setTargetType(TargetType.LOCAL); + GrootStreamServer.run(executeCommandArgs.buildCommand()); + } + + public static String getTestConfigFile(String configFile) + throws FileNotFoundException, URISyntaxException { + URL resource = CnExample.class.getResource(configFile); + if (resource == null) { + throw new FileNotFoundException("Can't find config file: " + configFile); + } + return Paths.get(resource.toURI()).toString(); + } +} diff --git a/config/cn/cn_grootstream_job_local_template.yaml b/groot-examples/cn-example/src/main/resources/example/cn_grootstream_job_local_template.yaml index 5a8fcb0..5a8fcb0 100644 --- a/config/cn/cn_grootstream_job_local_template.yaml +++ b/groot-examples/cn-example/src/main/resources/example/cn_grootstream_job_local_template.yaml diff --git a/config/cn/cn_grootstream_job_template.yaml b/groot-examples/cn-example/src/main/resources/example/cn_grootstream_job_template.yaml index 7c448f6..7c448f6 100644 --- a/config/cn/cn_grootstream_job_template.yaml +++ b/groot-examples/cn-example/src/main/resources/example/cn_grootstream_job_template.yaml diff --git a/config/cn/grootstream.yaml b/groot-examples/cn-example/src/main/resources/grootstream.yaml index 558030c..558030c 100644 --- a/config/cn/grootstream.yaml +++ b/groot-examples/cn-example/src/main/resources/grootstream.yaml diff --git a/config/cn/udf.plugins b/groot-examples/cn-example/src/main/resources/udf.plugins index 22804f6..22804f6 100644 --- a/config/cn/udf.plugins +++ b/groot-examples/cn-example/src/main/resources/udf.plugins diff --git a/groot-examples/inline-to-print-example/pom.xml b/groot-examples/inline-to-print-example/pom.xml new file mode 100644 index 0000000..771b633 --- /dev/null +++ b/groot-examples/inline-to-print-example/pom.xml @@ -0,0 +1,15 @@ +<?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> + <parent> + <groupId>com.geedgenetworks</groupId> + <artifactId>groot-examples</artifactId> + <version>${revision}</version> + </parent> + + <artifactId>inline-to-print-example</artifactId> + <name>Groot : Examples : Inline-to-print</name> + +</project>
\ No newline at end of file diff --git a/groot-example/src/main/java/com/geedgenetworks/example/InlineToPrintExample.java b/groot-examples/inline-to-print-example/src/main/java/com/geedgenetworks/example/InlineToPrintExample.java index c139879..c139879 100644 --- a/groot-example/src/main/java/com/geedgenetworks/example/InlineToPrintExample.java +++ b/groot-examples/inline-to-print-example/src/main/java/com/geedgenetworks/example/InlineToPrintExample.java diff --git a/groot-example/src/main/resources/examples/inline_to_clickhouse.yaml b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_clickhouse.yaml index 370b7a8..370b7a8 100644 --- a/groot-example/src/main/resources/examples/inline_to_clickhouse.yaml +++ b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_clickhouse.yaml diff --git a/groot-example/src/main/resources/examples/inline_to_kafka.yaml b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_kafka.yaml index 44355c7..44355c7 100644 --- a/groot-example/src/main/resources/examples/inline_to_kafka.yaml +++ b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_kafka.yaml diff --git a/groot-example/src/main/resources/examples/inline_to_print.yaml b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_print.yaml index daf6e32..daf6e32 100644 --- a/groot-example/src/main/resources/examples/inline_to_print.yaml +++ b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_print.yaml diff --git a/groot-example/src/main/resources/examples/inline_to_print_test.yaml b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_print_test.yaml index d42c05a..d42c05a 100644 --- a/groot-example/src/main/resources/examples/inline_to_print_test.yaml +++ b/groot-examples/inline-to-print-example/src/main/resources/examples/inline_to_print_test.yaml diff --git a/groot-example/src/main/resources/examples/kafka_to_print.yaml b/groot-examples/inline-to-print-example/src/main/resources/examples/kafka_to_print.yaml index 523d529..523d529 100644 --- a/groot-example/src/main/resources/examples/kafka_to_print.yaml +++ b/groot-examples/inline-to-print-example/src/main/resources/examples/kafka_to_print.yaml diff --git a/groot-example/src/main/resources/log4j2.properties b/groot-examples/inline-to-print-example/src/main/resources/log4j2.properties index 2dc1b8c..2dc1b8c 100644 --- a/groot-example/src/main/resources/log4j2.properties +++ b/groot-examples/inline-to-print-example/src/main/resources/log4j2.properties diff --git a/groot-example/pom.xml b/groot-examples/pom.xml index 851db2c..1077e6b 100644 --- a/groot-example/pom.xml +++ b/groot-examples/pom.xml @@ -9,9 +9,13 @@ <version>${revision}</version> </parent> - <artifactId>groot-example</artifactId> - <name>Groot : Example </name> - <!-- <packaging>pom</packaging>--> + <artifactId>groot-examples</artifactId> + <name>Groot : Examples :</name> + <packaging>pom</packaging> + <modules> + <module>inline-to-print-example</module> + <module>cn-example</module> + </modules> <properties> <scope>provided</scope> @@ -17,7 +17,7 @@ <module>groot-bootstrap</module> <module>groot-release</module> <module>groot-shaded</module> - <module>groot-example</module> + <module>groot-examples</module> <module>groot-formats</module> <module>groot-tests</module> </modules> |
