You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/14 06:47:54 UTC

[GitHub] [incubator-seatunnel] Hisoka-X opened a new pull request, #2726: [Starter] [Core] Modify connector v2 starter

Hisoka-X opened a new pull request, #2726:
URL: https://github.com/apache/incubator-seatunnel/pull/2726

   Modify connector v2 starter and remove spark/flink in seatunnel-core-starter
   
   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   SubTask for #2690 
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] Hisoka-X commented on pull request #2726: [Starter] [Core] Modify connector v2 starter

Posted by GitBox <gi...@apache.org>.
Hisoka-X commented on PR #2726:
URL: https://github.com/apache/incubator-seatunnel/pull/2726#issuecomment-1246442008

   @ashulin @hailin0 Hi, Please check again, thanks!


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] EricJoy2048 merged pull request #2726: [Starter] [Core] Modify connector v2 starter

Posted by GitBox <gi...@apache.org>.
EricJoy2048 merged PR #2726:
URL: https://github.com/apache/incubator-seatunnel/pull/2726


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] Hisoka-X commented on a diff in pull request #2726: [Starter] [Core] Modify connector v2 starter

Posted by GitBox <gi...@apache.org>.
Hisoka-X commented on code in PR #2726:
URL: https://github.com/apache/incubator-seatunnel/pull/2726#discussion_r970433372


##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/config/ExecutionFactory.java:
##########
@@ -1,84 +0,0 @@
-/*
- * 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.core.starter.config;
-
-import org.apache.seatunnel.apis.base.api.BaseSink;
-import org.apache.seatunnel.apis.base.api.BaseSource;
-import org.apache.seatunnel.apis.base.api.BaseTransform;
-import org.apache.seatunnel.apis.base.env.Execution;
-import org.apache.seatunnel.apis.base.env.RuntimeEnv;
-import org.apache.seatunnel.flink.FlinkEnvironment;
-import org.apache.seatunnel.flink.batch.FlinkBatchExecution;
-import org.apache.seatunnel.flink.stream.FlinkStreamExecution;
-import org.apache.seatunnel.spark.SparkEnvironment;
-import org.apache.seatunnel.spark.batch.SparkBatchExecution;
-import org.apache.seatunnel.spark.stream.SparkStreamingExecution;
-import org.apache.seatunnel.spark.structuredstream.StructuredStreamingExecution;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Used to create {@link Execution}.
- *
- * @param <ENVIRONMENT> environment type
- */
-public class ExecutionFactory<ENVIRONMENT extends RuntimeEnv> {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(ExecutionFactory.class);
-
-    public AbstractExecutionContext<ENVIRONMENT> executionContext;
-
-    public ExecutionFactory(AbstractExecutionContext<ENVIRONMENT> executionContext) {
-        this.executionContext = executionContext;
-    }
-
-    public Execution<BaseSource<ENVIRONMENT>, BaseTransform<ENVIRONMENT>, BaseSink<ENVIRONMENT>, ENVIRONMENT> createExecution() {
-        Execution execution = null;
-        switch (executionContext.getEngine()) {
-            case SPARK:
-                SparkEnvironment sparkEnvironment = (SparkEnvironment) executionContext.getEnvironment();
-                switch (executionContext.getJobMode()) {
-                    case STREAMING:
-                        execution = new SparkStreamingExecution(sparkEnvironment);
-                        break;
-                    case STRUCTURED_STREAMING:
-                        execution = new StructuredStreamingExecution(sparkEnvironment);
-                        break;
-                    default:
-                        execution = new SparkBatchExecution(sparkEnvironment);
-                }
-                break;
-            case FLINK:
-                FlinkEnvironment flinkEnvironment = (FlinkEnvironment) executionContext.getEnvironment();
-                switch (executionContext.getJobMode()) {
-                    case STREAMING:
-                        execution = new FlinkStreamExecution(flinkEnvironment);
-                        break;
-                    default:
-                        execution = new FlinkBatchExecution(flinkEnvironment);
-                }
-                break;
-            default:
-                throw new IllegalArgumentException("No suitable engine");
-        }
-        LOGGER.info("current execution is [{}]", execution.getClass().getName());
-        return (Execution<BaseSource<ENVIRONMENT>, BaseTransform<ENVIRONMENT>, BaseSink<ENVIRONMENT>, ENVIRONMENT>) execution;

Review Comment:
   This Factory never be used in connector-v2, same logic in FlinkEnvironment/SparkEnvironment.



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] Hisoka-X commented on a diff in pull request #2726: [Starter] [Core] Modify connector v2 starter

Posted by GitBox <gi...@apache.org>.
Hisoka-X commented on code in PR #2726:
URL: https://github.com/apache/incubator-seatunnel/pull/2726#discussion_r970428783


##########
seatunnel-core/seatunnel-flink-starter/src/main/java/org/apache/seatunnel/core/starter/flink/config/FlinkJobType.java:
##########
@@ -18,9 +18,7 @@
 package org.apache.seatunnel.core.starter.flink.config;
 
 public enum FlinkJobType {
-    JAR("start-seatunnel-flink.sh"),
-    SQL("start-seatunnel-sql.sh"),
-    ;
+    JAR("start-seatunnel-flink-connector-v2.sh");
 

Review Comment:
   Yes, I will remove it.



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] ashulin commented on a diff in pull request #2726: [Starter] [Core] Modify connector v2 starter

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2726:
URL: https://github.com/apache/incubator-seatunnel/pull/2726#discussion_r970425889


##########
seatunnel-core/seatunnel-flink-starter/src/main/java/org/apache/seatunnel/core/starter/flink/config/FlinkJobType.java:
##########
@@ -18,9 +18,7 @@
 package org.apache.seatunnel.core.starter.flink.config;
 
 public enum FlinkJobType {
-    JAR("start-seatunnel-flink.sh"),
-    SQL("start-seatunnel-sql.sh"),
-    ;
+    JAR("start-seatunnel-flink-connector-v2.sh");
 

Review Comment:
   Is this still used? flink-starter will only start this shell



##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/config/ExecutionFactory.java:
##########
@@ -1,84 +0,0 @@
-/*
- * 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.core.starter.config;
-
-import org.apache.seatunnel.apis.base.api.BaseSink;
-import org.apache.seatunnel.apis.base.api.BaseSource;
-import org.apache.seatunnel.apis.base.api.BaseTransform;
-import org.apache.seatunnel.apis.base.env.Execution;
-import org.apache.seatunnel.apis.base.env.RuntimeEnv;
-import org.apache.seatunnel.flink.FlinkEnvironment;
-import org.apache.seatunnel.flink.batch.FlinkBatchExecution;
-import org.apache.seatunnel.flink.stream.FlinkStreamExecution;
-import org.apache.seatunnel.spark.SparkEnvironment;
-import org.apache.seatunnel.spark.batch.SparkBatchExecution;
-import org.apache.seatunnel.spark.stream.SparkStreamingExecution;
-import org.apache.seatunnel.spark.structuredstream.StructuredStreamingExecution;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Used to create {@link Execution}.
- *
- * @param <ENVIRONMENT> environment type
- */
-public class ExecutionFactory<ENVIRONMENT extends RuntimeEnv> {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(ExecutionFactory.class);
-
-    public AbstractExecutionContext<ENVIRONMENT> executionContext;
-
-    public ExecutionFactory(AbstractExecutionContext<ENVIRONMENT> executionContext) {
-        this.executionContext = executionContext;
-    }
-
-    public Execution<BaseSource<ENVIRONMENT>, BaseTransform<ENVIRONMENT>, BaseSink<ENVIRONMENT>, ENVIRONMENT> createExecution() {
-        Execution execution = null;
-        switch (executionContext.getEngine()) {
-            case SPARK:
-                SparkEnvironment sparkEnvironment = (SparkEnvironment) executionContext.getEnvironment();
-                switch (executionContext.getJobMode()) {
-                    case STREAMING:
-                        execution = new SparkStreamingExecution(sparkEnvironment);
-                        break;
-                    case STRUCTURED_STREAMING:
-                        execution = new StructuredStreamingExecution(sparkEnvironment);
-                        break;
-                    default:
-                        execution = new SparkBatchExecution(sparkEnvironment);
-                }
-                break;
-            case FLINK:
-                FlinkEnvironment flinkEnvironment = (FlinkEnvironment) executionContext.getEnvironment();
-                switch (executionContext.getJobMode()) {
-                    case STREAMING:
-                        execution = new FlinkStreamExecution(flinkEnvironment);
-                        break;
-                    default:
-                        execution = new FlinkBatchExecution(flinkEnvironment);
-                }
-                break;
-            default:
-                throw new IllegalArgumentException("No suitable engine");
-        }
-        LOGGER.info("current execution is [{}]", execution.getClass().getName());
-        return (Execution<BaseSource<ENVIRONMENT>, BaseTransform<ENVIRONMENT>, BaseSink<ENVIRONMENT>, ENVIRONMENT>) execution;

Review Comment:
   Where did this part of the logic change go?



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-seatunnel] ashulin commented on a diff in pull request #2726: [Starter] [Core] Modify connector v2 starter

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2726:
URL: https://github.com/apache/incubator-seatunnel/pull/2726#discussion_r970448343


##########
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/config/ExecutionFactory.java:
##########
@@ -1,84 +0,0 @@
-/*
- * 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.core.starter.config;
-
-import org.apache.seatunnel.apis.base.api.BaseSink;
-import org.apache.seatunnel.apis.base.api.BaseSource;
-import org.apache.seatunnel.apis.base.api.BaseTransform;
-import org.apache.seatunnel.apis.base.env.Execution;
-import org.apache.seatunnel.apis.base.env.RuntimeEnv;
-import org.apache.seatunnel.flink.FlinkEnvironment;
-import org.apache.seatunnel.flink.batch.FlinkBatchExecution;
-import org.apache.seatunnel.flink.stream.FlinkStreamExecution;
-import org.apache.seatunnel.spark.SparkEnvironment;
-import org.apache.seatunnel.spark.batch.SparkBatchExecution;
-import org.apache.seatunnel.spark.stream.SparkStreamingExecution;
-import org.apache.seatunnel.spark.structuredstream.StructuredStreamingExecution;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Used to create {@link Execution}.
- *
- * @param <ENVIRONMENT> environment type
- */
-public class ExecutionFactory<ENVIRONMENT extends RuntimeEnv> {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(ExecutionFactory.class);
-
-    public AbstractExecutionContext<ENVIRONMENT> executionContext;
-
-    public ExecutionFactory(AbstractExecutionContext<ENVIRONMENT> executionContext) {
-        this.executionContext = executionContext;
-    }
-
-    public Execution<BaseSource<ENVIRONMENT>, BaseTransform<ENVIRONMENT>, BaseSink<ENVIRONMENT>, ENVIRONMENT> createExecution() {
-        Execution execution = null;
-        switch (executionContext.getEngine()) {
-            case SPARK:
-                SparkEnvironment sparkEnvironment = (SparkEnvironment) executionContext.getEnvironment();
-                switch (executionContext.getJobMode()) {
-                    case STREAMING:
-                        execution = new SparkStreamingExecution(sparkEnvironment);
-                        break;
-                    case STRUCTURED_STREAMING:
-                        execution = new StructuredStreamingExecution(sparkEnvironment);
-                        break;
-                    default:
-                        execution = new SparkBatchExecution(sparkEnvironment);
-                }
-                break;
-            case FLINK:
-                FlinkEnvironment flinkEnvironment = (FlinkEnvironment) executionContext.getEnvironment();
-                switch (executionContext.getJobMode()) {
-                    case STREAMING:
-                        execution = new FlinkStreamExecution(flinkEnvironment);
-                        break;
-                    default:
-                        execution = new FlinkBatchExecution(flinkEnvironment);
-                }
-                break;
-            default:
-                throw new IllegalArgumentException("No suitable engine");
-        }
-        LOGGER.info("current execution is [{}]", execution.getClass().getName());
-        return (Execution<BaseSource<ENVIRONMENT>, BaseTransform<ENVIRONMENT>, BaseSink<ENVIRONMENT>, ENVIRONMENT>) execution;

Review Comment:
   ok



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org