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/05/25 08:52:00 UTC

[GitHub] [incubator-seatunnel] gaojun2048 opened a new pull request, #1948: Add SeaTunnel Engine

gaojun2048 opened a new pull request, #1948:
URL: https://github.com/apache/incubator-seatunnel/pull/1948

   <!--
   
   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
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   Added a new module named `seatunnel-engine`. 
   
   
   ## 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] CalvinKirs commented on a diff in pull request #1948: Add SeaTunnel Engine

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


##########
seatunnel-engine/src/test/java/org/apache/seatunnel/engine/execution/TaskExecutionTest.java:
##########
@@ -0,0 +1,83 @@
+/*
+ * 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.engine.execution;
+
+import org.apache.seatunnel.engine.api.common.JobID;
+import org.apache.seatunnel.engine.api.example.SimpleSinkWriter;
+import org.apache.seatunnel.engine.api.example.SimpleSourceReader;
+import org.apache.seatunnel.engine.api.source.Boundedness;
+import org.apache.seatunnel.engine.config.Configuration;
+import org.apache.seatunnel.engine.executionplan.ExecutionId;
+import org.apache.seatunnel.engine.executionplan.JobInformation;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+public class TaskExecutionTest {
+
+    @SuppressWarnings("checkstyle:MagicNumber")
+    @Test
+    public void testRunTask() throws InterruptedException {
+        JobInformation jobInformation = new JobInformation(new JobID(), "test fake job", new Configuration(), Boundedness.BOUNDED);
+
+        TaskInfo taskInfo = new TaskInfo(
+                jobInformation,
+                new ExecutionId(),
+                1,
+                Boundedness.BOUNDED,
+                new SimpleSourceReader(),
+                new ArrayList<>(),
+                new SimpleSinkWriter());
+
+        // set batchTask thread name
+        ThreadFactory batchTaskThreadFactory = new ThreadFactoryBuilder()
+                .setNameFormat("test-batch-task-pool-%d").build();
+
+        // build batchTask thread pool
+
+        ExecutorService executorService = new ThreadPoolExecutor(
+                2,
+                2,
+                0L,
+                TimeUnit.MILLISECONDS,
+                new LinkedBlockingQueue<>(2),
+                batchTaskThreadFactory,
+                new ThreadPoolExecutor.AbortPolicy());
+
+        TaskExecution taskExecution = new TaskExecution(executorService, null);
+
+        taskExecution.submit(taskInfo);
+
+        Thread.sleep(500L);
+
+        Assert.assertEquals(taskExecution.aliveTaskSize(), 1);
+
+        Thread.sleep(5000L);
+

Review Comment:
   Is this test stable?



-- 
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] CalvinKirs commented on a diff in pull request #1948: Add SeaTunnel Engine

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


##########
seatunnel-engine/src/test/java/org/apache/seatunnel/engine/maintest/SeaTunnelEngineMainTest.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.engine.maintest;
+
+import org.apache.seatunnel.engine.api.context.LocalExecutionContext;
+import org.apache.seatunnel.engine.api.example.SimpleSink;
+import org.apache.seatunnel.engine.api.example.SimpleSource;
+import org.apache.seatunnel.engine.config.Configuration;
+import org.apache.seatunnel.engine.execution.TaskExecution;
+import org.apache.seatunnel.engine.jobmanager.JobMaster;
+import org.apache.seatunnel.engine.jobmanager.JobMasterId;
+import org.apache.seatunnel.engine.logicalplan.LogicalPlan;
+import org.apache.seatunnel.engine.utils.SeaTunnelExecutionThreadFactory;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+
+public class SeaTunnelEngineMainTest {
+    protected final Logger logger = LoggerFactory.getLogger(SeaTunnelEngineMainTest.class);
+
+    @Before
+    public void before() throws Exception {
+    }
+
+    @After
+    public void after() throws Exception {
+    }
+

Review Comment:
   If it doesn't make sense to me.



-- 
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] gaojun2048 commented on pull request #1948: Add SeaTunnel Engine

Posted by GitBox <gi...@apache.org>.
gaojun2048 commented on PR #1948:
URL: https://github.com/apache/incubator-seatunnel/pull/1948#issuecomment-1147498065

   > hi @gaojun2048, looked over your patch, it seems like a scaled-down flink, can the engine run on other resource framework? like yarn or kerberos?
   
   Yes, it looks like a scaled down Flink. Flink is very mature in task scheduling and running. In order to quickly complete the functions of a basic version, I tried to refer to Flink in my design, because many designs in Flink are easier to be accepted. When we can run basic task scheduling and task execution, Next, we should focus on the problems that seatunnel engine really needs to solve. The design goal of seatunnel engine is to solve the problems in these data synchronization scenarios, rather than developing a computing engine like Flink.
   
   > can the engine run on other resource framework? like yarn or kerberos?
   
   Yes, I hope the seatunnel engine can support yarn and k8s, but I can't do such a huge job alone. I need the support and help of the community.


-- 
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] leo65535 commented on pull request #1948: Add SeaTunnel Engine

Posted by GitBox <gi...@apache.org>.
leo65535 commented on PR #1948:
URL: https://github.com/apache/incubator-seatunnel/pull/1948#issuecomment-1147001719

   hi @gaojun2048, looked over your patch, it seems like a scaled-down flink, can the engine run on other resource framework? like yarn or kerberos?


-- 
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 commented on a diff in pull request #1948: Add SeaTunnel Engine

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


##########
seatunnel-engine/src/test/java/org/apache/seatunnel/engine/execution/TaskExecutionTest.java:
##########
@@ -0,0 +1,83 @@
+/*
+ * 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.engine.execution;
+
+import org.apache.seatunnel.engine.api.common.JobID;
+import org.apache.seatunnel.engine.api.example.SimpleSinkWriter;
+import org.apache.seatunnel.engine.api.example.SimpleSourceReader;
+import org.apache.seatunnel.engine.api.source.Boundedness;
+import org.apache.seatunnel.engine.config.Configuration;
+import org.apache.seatunnel.engine.executionplan.ExecutionId;
+import org.apache.seatunnel.engine.executionplan.JobInformation;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+public class TaskExecutionTest {
+
+    @SuppressWarnings("checkstyle:MagicNumber")
+    @Test
+    public void testRunTask() throws InterruptedException {
+        JobInformation jobInformation = new JobInformation(new JobID(), "test fake job", new Configuration(), Boundedness.BOUNDED);
+
+        TaskInfo taskInfo = new TaskInfo(
+                jobInformation,
+                new ExecutionId(),
+                1,
+                Boundedness.BOUNDED,
+                new SimpleSourceReader(),
+                new ArrayList<>(),
+                new SimpleSinkWriter());
+
+        // set batchTask thread name
+        ThreadFactory batchTaskThreadFactory = new ThreadFactoryBuilder()
+                .setNameFormat("test-batch-task-pool-%d").build();
+
+        // build batchTask thread pool
+
+        ExecutorService executorService = new ThreadPoolExecutor(
+                2,
+                2,
+                0L,
+                TimeUnit.MILLISECONDS,
+                new LinkedBlockingQueue<>(2),
+                batchTaskThreadFactory,
+                new ThreadPoolExecutor.AbortPolicy());
+
+        TaskExecution taskExecution = new TaskExecution(executorService, null);
+
+        taskExecution.submit(taskInfo);
+
+        Thread.sleep(500L);
+
+        Assert.assertEquals(taskExecution.aliveTaskSize(), 1);
+
+        Thread.sleep(5000L);
+

Review Comment:
   yes.



-- 
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] CalvinKirs closed pull request #1948: Add SeaTunnel Engine

Posted by GitBox <gi...@apache.org>.
CalvinKirs closed pull request #1948: Add SeaTunnel Engine 
URL: https://github.com/apache/incubator-seatunnel/pull/1948


-- 
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