forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-25430][runtime] Integrates JobResultStore initialization along…
… JobGraphStore initialization The goal is to do the recovery of dirty JobResults from the JobResultStore along the JobGraph recovery. Both will be pass through the call chain up to the Dispatcher. The *DispatcherLeaderProcess implementations take care of this recovery and make sure that any JobGraph that is recovered but has a matching dirty JobResult is not passed on into the Dispatcher. There's a dedicated Precondition checking this in the Dispatcher constructor itself.
- Loading branch information
Showing
35 changed files
with
968 additions
and
253 deletions.
There are no files selected for viewing
This file contains 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 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
75 changes: 75 additions & 0 deletions
75
flink-clients/src/test/java/org/apache/flink/client/testjar/ErrorHandlingSubmissionJob.java
This file contains 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,75 @@ | ||
/* | ||
* 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.flink.client.testjar; | ||
|
||
import org.apache.flink.api.java.ExecutionEnvironment; | ||
import org.apache.flink.api.java.io.DiscardingOutputFormat; | ||
import org.apache.flink.client.cli.CliFrontendTestUtils; | ||
import org.apache.flink.client.program.PackagedProgram; | ||
import org.apache.flink.client.program.ProgramInvocationException; | ||
import org.apache.flink.util.FlinkException; | ||
|
||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.net.MalformedURLException; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.concurrent.atomic.AtomicReference; | ||
|
||
/** | ||
* {@code ErrorHandlingSubmissionJob} provides a factory method for creating a {@link | ||
* PackagedProgram} that monitors the job submission within the job's {@code main} method. | ||
*/ | ||
public class ErrorHandlingSubmissionJob { | ||
|
||
private static final AtomicReference<Exception> SUBMISSION_EXCEPTION = new AtomicReference<>(); | ||
|
||
public static PackagedProgram createPackagedProgram() throws FlinkException { | ||
try { | ||
return PackagedProgram.newBuilder() | ||
.setUserClassPaths( | ||
Collections.singletonList( | ||
new File(CliFrontendTestUtils.getTestJarPath()) | ||
.toURI() | ||
.toURL())) | ||
.setEntryPointClassName(ErrorHandlingSubmissionJob.class.getName()) | ||
.build(); | ||
} catch (ProgramInvocationException | FileNotFoundException | MalformedURLException e) { | ||
throw new FlinkException("Could not load the provided entrypoint class.", e); | ||
} | ||
} | ||
|
||
public static void main(String[] args) throws Exception { | ||
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); | ||
env.fromCollection(Arrays.asList(1, 2, 3)) | ||
.map(element -> element + 1) | ||
.output(new DiscardingOutputFormat<>()); | ||
|
||
try { | ||
env.execute(); | ||
} catch (Exception e) { | ||
SUBMISSION_EXCEPTION.set(e); | ||
throw e; | ||
} | ||
} | ||
|
||
public static Exception getSubmissionException() { | ||
return SUBMISSION_EXCEPTION.get(); | ||
} | ||
} |
This file contains 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 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 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 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
Oops, something went wrong.