[
https://issues.apache.org/jira/browse/FLINK-5861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894289#comment-15894289
]
ASF GitHub Bot commented on FLINK-5861:
---------------------------------------
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/3395#discussion_r104135016
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobManagerConnection.java
---
@@ -98,4 +103,15 @@ public ResultPartitionConsumableNotifier
getResultPartitionConsumableNotifier()
public PartitionProducerStateChecker getPartitionStateChecker() {
return partitionStateChecker;
}
+
+ public void registerListener(JobManagerConnectionListener listener) {
+ jobManagerConnectionListeners.add(listener);
+ }
+
+ public void notifyListener(JobManagerConnection
newJobManagerConnection) {
+ for (JobManagerConnectionListener listener:
jobManagerConnectionListeners) {
+
listener.notifyJobManagerConnectionChanged(newJobManagerConnection.getJobManagerGateway(),
+ newJobManagerConnection.getLeaderId());
+ }
+ }
--- End diff --
Why do you need this listener pattern here? `JobManagerConnection` already
holds a reference to all except for the `InputSplitProvider` instances.
> TaskManager's components support updating JobManagerConnection
> --------------------------------------------------------------
>
> Key: FLINK-5861
> URL: https://issues.apache.org/jira/browse/FLINK-5861
> Project: Flink
> Issue Type: Sub-task
> Components: Distributed Coordination, JobManager
> Reporter: Biao Liu
> Assignee: Biao Liu
> Fix For: 1.3.0
>
>
> Some components in TaskManager, such as TaskManagerActions,
> CheckpointResponder, ResultPartitionConsumableNotifier,
> PartitionProducerStateChecker, need to support updating JobManagerConnection.
> So when JobManager fails and recovers, the tasks who keep old
> JobManagerConnection can be notified to update JobManagerConnection. The
> tasks can continue doing their jobs without failure.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)