flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request #2594: [FLINK-4738] [TaskManager] Port TaskManager logic ...
Date Mon, 10 Oct 2016 08:38:39 GMT
Github user tillrohrmann commented on a diff in the pull request:

    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java
    @@ -507,12 +509,18 @@ public void suspendJob(final Throwable cause) {
     	 * @return Acknowledge the task execution state update
    -	public boolean updateTaskExecutionState(final TaskExecutionState taskExecutionState)
    +	public Acknowledge updateTaskExecutionState(final TaskExecutionState taskExecutionState)
throws ExecutionGraphException {
     		if (taskExecutionState == null) {
    -			return false;
    +			throw new NullPointerException("TaskExecutionState must not be null.");
    +		}
    +		if (executionGraph.updateState(taskExecutionState)) {
    +			return Acknowledge.get();
     		} else {
    -			return executionGraph.updateState(taskExecutionState);
    +			throw new ExecutionGraphException("The execution attempt " +
    --- End diff --
    Yes we could do this. I decided against it, however, because I didn't want to touch the
`ExecutionGraph` with this PR (it's already touching too many files ;-). Furthermore, the
`updateState` method is defined such that it returns `false` iff the execution attempt could
not be found. Otherwise it can update the state and returns `true`. Therefore, I thought that
it would  be ok to throw the exception at this level.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message