-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Feature] [api env] Add job-level configuration for checkpoint timeout. #5222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
29505ed
[Feature] [api env] Add job-level configuration for checkpoint timeout.
ic4y 6e7d85c
add job leve checkpoint timeout Test
ic4y 441d14d
Merge branch 'dev' into dev-addTimeout
ic4y bf7b016
add license header
ic4y df3ed41
add license header
ic4y 7e57ff5
Merge branch 'dev' into dev-addTimeout
ic4y 377e1ce
Update CheckpointTimeOutTest.java
ic4y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
...er/src/test/java/org/apache/seatunnel/engine/server/checkpoint/CheckpointTimeOutTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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.server.checkpoint; | ||
|
|
||
| import org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture; | ||
| import org.apache.seatunnel.engine.core.dag.logical.LogicalDag; | ||
| import org.apache.seatunnel.engine.core.job.JobImmutableInformation; | ||
| import org.apache.seatunnel.engine.core.job.JobStatus; | ||
| import org.apache.seatunnel.engine.server.AbstractSeaTunnelServerTest; | ||
| import org.apache.seatunnel.engine.server.TestUtils; | ||
|
|
||
| import org.junit.jupiter.api.Assertions; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import com.hazelcast.internal.serialization.Data; | ||
|
|
||
| import java.util.Collections; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| import static org.awaitility.Awaitility.await; | ||
|
|
||
| public class CheckpointTimeOutTest extends AbstractSeaTunnelServerTest { | ||
|
|
||
| public static String CONF_PATH = "stream_fake_to_console_checkpointTimeOut.conf"; | ||
| public static long JOB_ID = System.currentTimeMillis(); | ||
|
|
||
| @Test | ||
| public void testJobLevelCheckpointTimeOut() { | ||
| startJob(JOB_ID, CONF_PATH); | ||
|
|
||
| await().atMost(120000, TimeUnit.MILLISECONDS) | ||
| .untilAsserted( | ||
| () -> { | ||
| Assertions.assertTrue( | ||
| server.getCoordinatorService() | ||
| .getJobStatus(JOB_ID) | ||
| .equals(JobStatus.RUNNING)); | ||
| }); | ||
|
|
||
| await().atMost(120000, TimeUnit.MILLISECONDS) | ||
| .untilAsserted( | ||
| () -> { | ||
| Assertions.assertTrue( | ||
| server.getCoordinatorService() | ||
| .getJobStatus(JOB_ID) | ||
| .equals(JobStatus.FAILED)); | ||
| }); | ||
| } | ||
|
|
||
| private void startJob(Long jobid, String path) { | ||
| LogicalDag testLogicalDag = TestUtils.createTestLogicalPlan(path, jobid.toString(), jobid); | ||
|
|
||
| JobImmutableInformation jobImmutableInformation = | ||
| new JobImmutableInformation( | ||
| jobid, | ||
| "Test", | ||
| false, | ||
| nodeEngine.getSerializationService().toData(testLogicalDag), | ||
| testLogicalDag.getJobConfig(), | ||
| Collections.emptyList()); | ||
|
|
||
| Data data = nodeEngine.getSerializationService().toData(jobImmutableInformation); | ||
|
|
||
| PassiveCompletableFuture<Void> voidPassiveCompletableFuture = | ||
| server.getCoordinatorService().submitJob(jobid, data); | ||
| voidPassiveCompletableFuture.join(); | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
.../seatunnel-engine-server/src/test/resources/stream_fake_to_console_checkpointTimeOut.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # | ||
| # 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. | ||
| # | ||
| ###### | ||
| ###### This config file is a demonstration of streaming processing in seatunnel config | ||
| ###### | ||
|
|
||
| env { | ||
| # You can set flink configuration here | ||
| execution.parallelism = 1 | ||
| job.mode = "STREAMING" | ||
| checkpoint.interval = 1000 | ||
| checkpoint.timeout = 100 | ||
| } | ||
|
|
||
| source { | ||
| # This is a example source plugin **only for test and demonstrate the feature source plugin** | ||
| FakeSource { | ||
| result_table_name = "fake1" | ||
| row.num = 1000 | ||
| split.num = 100 | ||
| split.read-interval = 3000 | ||
| parallelism = 1 | ||
| schema = { | ||
| fields { | ||
| name = "string" | ||
| age = "int" | ||
| } | ||
| } | ||
| parallelism = 1 | ||
| } | ||
| } | ||
|
|
||
| transform { | ||
| } | ||
|
|
||
| sink { | ||
| console { | ||
| log.print.delay.ms=5000 | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.