flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject flink git commit: [jobmanager] fix warning about non-exhaustive case matching
Date Mon, 31 Aug 2015 11:53:52 GMT
Repository: flink
Updated Branches:
  refs/heads/master b9de4ed37 -> d5a90279f


[jobmanager] fix warning about non-exhaustive case matching

- fixed warning by adding a catch all case
- corrected indention of code block

hint: use -w to ignore the whitespace in the diff,
      e.g. git log -u -w


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

Branch: refs/heads/master
Commit: d5a90279fec810965da1a06bf7c90e7123c2719b
Parents: b9de4ed
Author: Maximilian Michels <mxm@apache.org>
Authored: Mon Aug 31 13:42:21 2015 +0200
Committer: Maximilian Michels <mxm@apache.org>
Committed: Mon Aug 31 13:53:17 2015 +0200

----------------------------------------------------------------------
 .../flink/runtime/jobmanager/JobManager.scala   | 49 +++++++++++---------
 1 file changed, 26 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/d5a90279/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
index 26bf91b..18c453f 100644
--- a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
+++ b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
@@ -824,33 +824,36 @@ class JobManager(
    * @param message The accumulator message.
    */
   private def handleAccumulatorMessage(message: AccumulatorMessage): Unit = {
-      message match {
-        case RequestAccumulatorResults(jobID) =>
-          try {
-            currentJobs.get(jobID) match {
-              case Some((graph, jobInfo)) =>
-                val accumulatorValues = graph.getAccumulatorsSerialized()
-                sender() ! decorateMessage(AccumulatorResultsFound(jobID, accumulatorValues))
-              case None =>
-                archive.forward(message)
-            }
-          } catch {
-          case e: Exception =>
-            log.error("Cannot serialize accumulator result.", e)
-            sender() ! decorateMessage(AccumulatorResultsErroneous(jobID, e))
-          }
-
-        case RequestAccumulatorResultsStringified(jobId) =>
-          currentJobs.get(jobId) match {
+    message match {
+      case RequestAccumulatorResults(jobID) =>
+        try {
+          currentJobs.get(jobID) match {
             case Some((graph, jobInfo)) =>
-              val stringifiedAccumulators = graph.getAccumulatorResultsStringified()
-              sender() ! decorateMessage(
-                AccumulatorResultStringsFound(jobId, stringifiedAccumulators)
-              )
+              val accumulatorValues = graph.getAccumulatorsSerialized()
+              sender() ! decorateMessage(AccumulatorResultsFound(jobID, accumulatorValues))
             case None =>
               archive.forward(message)
           }
-      }
+        } catch {
+        case e: Exception =>
+          log.error("Cannot serialize accumulator result.", e)
+          sender() ! decorateMessage(AccumulatorResultsErroneous(jobID, e))
+        }
+
+      case RequestAccumulatorResultsStringified(jobId) =>
+        currentJobs.get(jobId) match {
+          case Some((graph, jobInfo)) =>
+            val stringifiedAccumulators = graph.getAccumulatorResultsStringified()
+            sender() ! decorateMessage(
+              AccumulatorResultStringsFound(jobId, stringifiedAccumulators)
+            )
+          case None =>
+            archive.forward(message)
+        }
+
+      case unknown =>
+        log.warn(s"Received unknown AccumulatorMessage: $unknown")
+    }
   }
 
   /**


Mime
View raw message