Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
MrLiuzy closed pull request #10272: [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project URL: https://github.com/apache/seatunnel/pull/10272 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
MrLiuzy commented on code in PR #10272:
URL: https://github.com/apache/seatunnel/pull/10272#discussion_r2661011773
##
seatunnel-examples/seatunnel-engine-examples/src/main/java/org/apache/seatunnel/example/engine/SeaTunnelEngineEmbeddedExample.java:
##
@@ -0,0 +1,418 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.example.engine;
+
+import
org.apache.seatunnel.shade.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.JsonNode;
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.ObjectMapper;
+import
org.apache.seatunnel.shade.com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+import org.apache.seatunnel.shade.org.apache.commons.lang3.ArrayUtils;
+
+import org.apache.seatunnel.api.common.metrics.JobMetrics;
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.api.options.EnvCommonOptions;
+import org.apache.seatunnel.api.table.catalog.TablePath;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.core.starter.utils.ConfigBuilder;
+import org.apache.seatunnel.engine.common.Constant;
+import org.apache.seatunnel.engine.common.config.ConfigProvider;
+import org.apache.seatunnel.engine.common.config.EngineConfig;
+import org.apache.seatunnel.engine.common.config.JobConfig;
+import org.apache.seatunnel.engine.common.config.SeaTunnelConfig;
+import org.apache.seatunnel.engine.common.job.JobResult;
+import org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture;
+import org.apache.seatunnel.engine.core.job.JobImmutableInformation;
+import org.apache.seatunnel.engine.server.CoordinatorService;
+import org.apache.seatunnel.engine.server.SeaTunnelServer;
+import org.apache.seatunnel.engine.server.SeaTunnelServerStarter;
+import org.apache.seatunnel.engine.server.rest.RestJobExecutionEnvironment;
+
+import com.hazelcast.instance.impl.HazelcastInstanceImpl;
+import com.hazelcast.internal.serialization.Data;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+/**
+ * Embed the Zeta engine as a tool in the project. Start a local cluster
instance in Cluster mode
+ * and use it to submit tasks, manage tasks, and query task metrics, etc.
+ */
+public class SeaTunnelEngineEmbeddedExample implements AutoCloseable {
+
+public static void main(String[] args) {
+try (SeaTunnelEngineEmbeddedExample server = new
SeaTunnelEngineEmbeddedExample(); ) {
+server.start();
+String json =
+"{\r\n"
++ "\"env\": {\r\n"
++ "\"job.mode\": \"batch\"\r\n"
++ "},\r\n"
++ "\"source\": [\r\n"
++ "{\r\n"
++ "\"plugin_name\":
\"FakeSource\",\r\n"
++ "\"plugin_output\": \"fake\",\r\n"
++ "\"row.num\": 100,\r\n"
++ "\"schema\": {\r\n"
++ "\"fields\": {\r\n"
++ "\"name\": \"string\",\r\n"
++ "\"age\": \"int\",\r\n"
++ "\"card\": \"int\"\r\n"
++ "}\r\n"
++ "}\r\n"
++ "}\r\n"
++ "],\r\n"
++ "\"transform\": [\r\n"
++ "],\r\n"
++ "\"sink\": [\r\n"
++ "{\r\n"
++ "\"plugin_name\": \"Console\",\r\n"
++ "\"plugin_input\": [\"fake\"]\r\n"
+
Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
zhangshenghang commented on code in PR #10272:
URL: https://github.com/apache/seatunnel/pull/10272#discussion_r2660072939
##
seatunnel-examples/seatunnel-engine-examples/src/main/java/org/apache/seatunnel/example/engine/SeaTunnelEngineEmbeddedExample.java:
##
@@ -0,0 +1,418 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.example.engine;
+
+import
org.apache.seatunnel.shade.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.JsonNode;
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.ObjectMapper;
+import
org.apache.seatunnel.shade.com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+import org.apache.seatunnel.shade.org.apache.commons.lang3.ArrayUtils;
+
+import org.apache.seatunnel.api.common.metrics.JobMetrics;
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.api.options.EnvCommonOptions;
+import org.apache.seatunnel.api.table.catalog.TablePath;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.core.starter.utils.ConfigBuilder;
+import org.apache.seatunnel.engine.common.Constant;
+import org.apache.seatunnel.engine.common.config.ConfigProvider;
+import org.apache.seatunnel.engine.common.config.EngineConfig;
+import org.apache.seatunnel.engine.common.config.JobConfig;
+import org.apache.seatunnel.engine.common.config.SeaTunnelConfig;
+import org.apache.seatunnel.engine.common.job.JobResult;
+import org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture;
+import org.apache.seatunnel.engine.core.job.JobImmutableInformation;
+import org.apache.seatunnel.engine.server.CoordinatorService;
+import org.apache.seatunnel.engine.server.SeaTunnelServer;
+import org.apache.seatunnel.engine.server.SeaTunnelServerStarter;
+import org.apache.seatunnel.engine.server.rest.RestJobExecutionEnvironment;
+
+import com.hazelcast.instance.impl.HazelcastInstanceImpl;
+import com.hazelcast.internal.serialization.Data;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+/**
+ * Embed the Zeta engine as a tool in the project. Start a local cluster
instance in Cluster mode
+ * and use it to submit tasks, manage tasks, and query task metrics, etc.
+ */
+public class SeaTunnelEngineEmbeddedExample implements AutoCloseable {
+
+public static void main(String[] args) {
+try (SeaTunnelEngineEmbeddedExample server = new
SeaTunnelEngineEmbeddedExample(); ) {
+server.start();
+String json =
+"{\r\n"
++ "\"env\": {\r\n"
++ "\"job.mode\": \"batch\"\r\n"
++ "},\r\n"
++ "\"source\": [\r\n"
++ "{\r\n"
++ "\"plugin_name\":
\"FakeSource\",\r\n"
++ "\"plugin_output\": \"fake\",\r\n"
++ "\"row.num\": 100,\r\n"
++ "\"schema\": {\r\n"
++ "\"fields\": {\r\n"
++ "\"name\": \"string\",\r\n"
++ "\"age\": \"int\",\r\n"
++ "\"card\": \"int\"\r\n"
++ "}\r\n"
++ "}\r\n"
++ "}\r\n"
++ "],\r\n"
++ "\"transform\": [\r\n"
++ "],\r\n"
++ "\"sink\": [\r\n"
++ "{\r\n"
++ "\"plugin_name\": \"Console\",\r\n"
++ "\"plugin_input\": [\"fake\"]\r\n"
+
Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
zhangshenghang commented on PR #10272: URL: https://github.com/apache/seatunnel/pull/10272#issuecomment-3708637384 Are there many such usage scenarios? Why isn't connecting with REST supported? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
zhangshenghang commented on code in PR #10272:
URL: https://github.com/apache/seatunnel/pull/10272#discussion_r2660069649
##
seatunnel-examples/seatunnel-engine-examples/src/main/java/org/apache/seatunnel/example/engine/SeaTunnelEngineEmbeddedExample.java:
##
@@ -0,0 +1,418 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.example.engine;
+
+import
org.apache.seatunnel.shade.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.JsonNode;
+import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.ObjectMapper;
+import
org.apache.seatunnel.shade.com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+import org.apache.seatunnel.shade.org.apache.commons.lang3.ArrayUtils;
+
+import org.apache.seatunnel.api.common.metrics.JobMetrics;
+import org.apache.seatunnel.api.configuration.ReadonlyConfig;
+import org.apache.seatunnel.api.options.EnvCommonOptions;
+import org.apache.seatunnel.api.table.catalog.TablePath;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.core.starter.utils.ConfigBuilder;
+import org.apache.seatunnel.engine.common.Constant;
+import org.apache.seatunnel.engine.common.config.ConfigProvider;
+import org.apache.seatunnel.engine.common.config.EngineConfig;
+import org.apache.seatunnel.engine.common.config.JobConfig;
+import org.apache.seatunnel.engine.common.config.SeaTunnelConfig;
+import org.apache.seatunnel.engine.common.job.JobResult;
+import org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture;
+import org.apache.seatunnel.engine.core.job.JobImmutableInformation;
+import org.apache.seatunnel.engine.server.CoordinatorService;
+import org.apache.seatunnel.engine.server.SeaTunnelServer;
+import org.apache.seatunnel.engine.server.SeaTunnelServerStarter;
+import org.apache.seatunnel.engine.server.rest.RestJobExecutionEnvironment;
+
+import com.hazelcast.instance.impl.HazelcastInstanceImpl;
+import com.hazelcast.internal.serialization.Data;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+/**
+ * Embed the Zeta engine as a tool in the project. Start a local cluster
instance in Cluster mode
+ * and use it to submit tasks, manage tasks, and query task metrics, etc.
+ */
+public class SeaTunnelEngineEmbeddedExample implements AutoCloseable {
+
+public static void main(String[] args) {
+try (SeaTunnelEngineEmbeddedExample server = new
SeaTunnelEngineEmbeddedExample(); ) {
+server.start();
+String json =
+"{\r\n"
++ "\"env\": {\r\n"
++ "\"job.mode\": \"batch\"\r\n"
++ "},\r\n"
++ "\"source\": [\r\n"
++ "{\r\n"
++ "\"plugin_name\":
\"FakeSource\",\r\n"
++ "\"plugin_output\": \"fake\",\r\n"
++ "\"row.num\": 100,\r\n"
++ "\"schema\": {\r\n"
++ "\"fields\": {\r\n"
++ "\"name\": \"string\",\r\n"
++ "\"age\": \"int\",\r\n"
++ "\"card\": \"int\"\r\n"
++ "}\r\n"
++ "}\r\n"
++ "}\r\n"
++ "],\r\n"
++ "\"transform\": [\r\n"
++ "],\r\n"
++ "\"sink\": [\r\n"
++ "{\r\n"
++ "\"plugin_name\": \"Console\",\r\n"
++ "\"plugin_input\": [\"fake\"]\r\n"
+
Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
MrLiuzy commented on PR #10272: URL: https://github.com/apache/seatunnel/pull/10272#issuecomment-3708176308 @davidzollo I have translated the Chinese description into English. Do I need to close this PR and then submit a new one instead? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
davidzollo commented on PR #10272: URL: https://github.com/apache/seatunnel/pull/10272#issuecomment-3708140708 CI failed https://github.com/user-attachments/assets/37b80114-ad81-4558-8966-b077fcc28266"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [Improve][seatunnel-examples][seatunnel-engine-examples] Add a usage example of embedding the zeta engine as a plugin in project [seatunnel]
davidzollo commented on code in PR #10272: URL: https://github.com/apache/seatunnel/pull/10272#discussion_r2659708725 ## seatunnel-examples/seatunnel-engine-examples/src/main/java/org/apache/seatunnel/example/engine/SeaTunnelEngineEmbeddedExample.java: ## @@ -0,0 +1,415 @@ +/* + * 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. + */ + +package org.apache.seatunnel.example.engine; + +import org.apache.seatunnel.shade.com.fasterxml.jackson.core.JsonProcessingException; +import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.JsonNode; +import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.seatunnel.shade.com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.seatunnel.shade.com.typesafe.config.Config; +import org.apache.seatunnel.shade.org.apache.commons.lang3.ArrayUtils; + +import org.apache.seatunnel.api.common.metrics.JobMetrics; +import org.apache.seatunnel.api.configuration.ReadonlyConfig; +import org.apache.seatunnel.api.options.EnvCommonOptions; +import org.apache.seatunnel.api.table.catalog.TablePath; +import org.apache.seatunnel.common.utils.JsonUtils; +import org.apache.seatunnel.core.starter.utils.ConfigBuilder; +import org.apache.seatunnel.engine.common.Constant; +import org.apache.seatunnel.engine.common.config.ConfigProvider; +import org.apache.seatunnel.engine.common.config.EngineConfig; +import org.apache.seatunnel.engine.common.config.JobConfig; +import org.apache.seatunnel.engine.common.config.SeaTunnelConfig; +import org.apache.seatunnel.engine.common.job.JobResult; +import org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture; +import org.apache.seatunnel.engine.core.job.JobImmutableInformation; +import org.apache.seatunnel.engine.server.CoordinatorService; +import org.apache.seatunnel.engine.server.SeaTunnelServer; +import org.apache.seatunnel.engine.server.SeaTunnelServerStarter; +import org.apache.seatunnel.engine.server.rest.RestJobExecutionEnvironment; + +import com.hazelcast.instance.impl.HazelcastInstanceImpl; +import com.hazelcast.internal.serialization.Data; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +/** 将SeaTunnel引擎当作工具的方式嵌入到项目中使用 */ Review Comment: As a Apache Project, please describe it in English, thx -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
