flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject flink git commit: [FLINK-4299] show loss of job manager in Client
Date Mon, 01 Aug 2016 17:01:09 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.1 fa3a3fc91 -> 4d988a925


[FLINK-4299] show loss of job manager in Client

This prints a message when the leading JobManager changes after first
connecting to a JobManager. Further, it prints a message when a connection
to a JobManager has been established.

This closes #2322.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/4d988a92
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/4d988a92
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/4d988a92

Branch: refs/heads/release-1.1
Commit: 4d988a9258bfc2adba47a9d802467fdfcea41dc4
Parents: fa3a3fc
Author: Maximilian Michels <mxm@apache.org>
Authored: Mon Aug 1 18:15:56 2016 +0200
Committer: Ufuk Celebi <uce@apache.org>
Committed: Mon Aug 1 19:00:59 2016 +0200

----------------------------------------------------------------------
 .../apache/flink/runtime/client/JobClientActor.java   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/4d988a92/flink-runtime/src/main/java/org/apache/flink/runtime/client/JobClientActor.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/client/JobClientActor.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/client/JobClientActor.java
index 2b3138a..9379c30 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/client/JobClientActor.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/client/JobClientActor.java
@@ -125,6 +125,11 @@ public class JobClientActor extends FlinkUntypedActor implements LeaderRetrieval
 		else if (message instanceof JobManagerLeaderAddress) {
 			JobManagerLeaderAddress msg = (JobManagerLeaderAddress) message;
 
+			if (jobManager != null) {
+				// only print this message when we had been connected to a JobManager before
+				logAndPrintMessage("New JobManager elected. Connecting to " + msg.address());
+			}
+
 			disconnectFromJobManager();
 
 			this.leaderSessionID = msg.leaderSessionID();
@@ -144,6 +149,8 @@ public class JobClientActor extends FlinkUntypedActor implements LeaderRetrieval
 			JobManagerActorRef msg = (JobManagerActorRef) message;
 			connectToJobManager(msg.jobManager());
 
+			logAndPrintMessage("Connected to JobManager at " +  msg.jobManager());
+
 			if (jobGraph != null && !jobSuccessfullySubmitted) {
 				// if we haven't yet submitted the job successfully
 				tryToSubmitJob(jobGraph);
@@ -280,6 +287,13 @@ public class JobClientActor extends FlinkUntypedActor implements LeaderRetrieval
 		return leaderSessionID;
 	}
 
+	private void logAndPrintMessage(String message) {
+		LOG.info(message);
+		if (sysoutUpdates) {
+			System.out.println(message);
+		}
+	}
+
 	private void logAndPrintMessage(ExecutionGraphMessages.ExecutionStateChanged message) {
 		LOG.info(message.toString());
 		if (sysoutUpdates) {


Mime
View raw message