This is an automated email from the ASF dual-hosted git repository.

trohrmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 9d51ad4e0fa8a89d8707ecd4f8b9ce20f8212783
Author: Till Rohrmann <trohrm...@apache.org>
AuthorDate: Wed Apr 24 14:10:30 2019 +0200

    [FLINK-12247] Add @Nullable annotation to 
AccessExecutionVertex#getPriorExecutionAttempt()
    
    This commit updates the AccessExecutionVertex#getPriorExecutionAttempt() 
interface to correctly
    denote that it can return a null value.
---
 .../org/apache/flink/runtime/executiongraph/AccessExecutionVertex.java | 3 +++
 .../apache/flink/runtime/executiongraph/ArchivedExecutionVertex.java   | 3 +++
 .../java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java  | 1 +
 3 files changed, 7 insertions(+)

diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/AccessExecutionVertex.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/AccessExecutionVertex.java
index 9faf3fb..54ce5e8 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/AccessExecutionVertex.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/AccessExecutionVertex.java
@@ -20,6 +20,8 @@ package org.apache.flink.runtime.executiongraph;
 import org.apache.flink.runtime.execution.ExecutionState;
 import org.apache.flink.runtime.taskmanager.TaskManagerLocation;
 
+import javax.annotation.Nullable;
+
 /**
  * Common interface for the runtime {@link ExecutionVertex} and {@link 
ArchivedExecutionVertex}.
  */
@@ -81,5 +83,6 @@ public interface AccessExecutionVertex {
         * @param attemptNumber attempt number of execution to be returned
         * @return execution for the given attempt number
         */
+       @Nullable
        AccessExecution getPriorExecutionAttempt(int attemptNumber);
 }
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionVertex.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionVertex.java
index 04efa04..fdeb0d8 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionVertex.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionVertex.java
@@ -21,6 +21,8 @@ import org.apache.flink.runtime.execution.ExecutionState;
 import org.apache.flink.runtime.taskmanager.TaskManagerLocation;
 import org.apache.flink.runtime.util.EvictingBoundedList;
 
+import javax.annotation.Nullable;
+
 import java.io.Serializable;
 
 public class ArchivedExecutionVertex implements AccessExecutionVertex, 
Serializable {
@@ -93,6 +95,7 @@ public class ArchivedExecutionVertex implements 
AccessExecutionVertex, Serializa
                return currentExecution.getAssignedResourceLocation();
        }
 
+       @Nullable
        @Override
        public ArchivedExecution getPriorExecutionAttempt(int attemptNumber) {
                if (attemptNumber >= 0 && attemptNumber < 
priorExecutions.size()) {
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java
index 8283f57..089301b 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java
@@ -305,6 +305,7 @@ public class ExecutionVertex implements 
AccessExecutionVertex, Archiveable<Archi
                return currentExecution.getAssignedResourceLocation();
        }
 
+       @Nullable
        @Override
        public ArchivedExecution getPriorExecutionAttempt(int attemptNumber) {
                synchronized (priorExecutions) {

Reply via email to