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/07 14:01:24 UTC

[GitHub] [incubator-seatunnel] EricJoy2048 commented on a diff in pull request #2667: [Feature][ST-Engine] Add handle checkpoint timeout

EricJoy2048 commented on code in PR #2667:
URL: https://github.com/apache/incubator-seatunnel/pull/2667#discussion_r964885598


##########
seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/TestUtils.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.server;
+
+import org.apache.seatunnel.api.common.SeaTunnelContext;
+import org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSink;
+import org.apache.seatunnel.connectors.seatunnel.fake.source.FakeSource;
+import org.apache.seatunnel.engine.common.utils.IdGenerator;
+import org.apache.seatunnel.engine.core.dag.actions.Action;
+import org.apache.seatunnel.engine.core.dag.actions.SinkAction;
+import org.apache.seatunnel.engine.core.dag.actions.SourceAction;
+import org.apache.seatunnel.engine.core.dag.logical.LogicalDag;
+import org.apache.seatunnel.engine.core.dag.logical.LogicalEdge;
+import org.apache.seatunnel.engine.core.dag.logical.LogicalVertex;
+
+import com.google.common.collect.Sets;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public class TestUtils {
+
+    @SuppressWarnings("checkstyle:MagicNumber")
+    public static LogicalDag getTestLogicalDag() throws MalformedURLException {
+        IdGenerator idGenerator = new IdGenerator();
+        FakeSource fakeSource = new FakeSource();
+        fakeSource.setSeaTunnelContext(SeaTunnelContext.getContext());
+
+        Action fake = new SourceAction<>(idGenerator.getNextId(), "fake", fakeSource,
+            Sets.newHashSet(new URL("file:///fake.jar")));
+        fake.setParallelism(3);
+        LogicalVertex fakeVertex = new LogicalVertex(fake.getId(), fake, 3);
+
+        ConsoleSink consoleSink = new ConsoleSink();
+        consoleSink.setSeaTunnelContext(SeaTunnelContext.getContext());
+        Action console = new SinkAction<>(idGenerator.getNextId(), "console", consoleSink,
+            Sets.newHashSet(new URL("file:///console.jar")));

Review Comment:
   > 
   
   No, it 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