hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject hadoop git commit: MAPREDUCE-6554. MRAppMaster servicestart failing with NPE in MRAppMaster#parsePreviousJobHistory. Contributed by Bibin A Chundatt (cherry picked from commit 296ecbd5ec9f7d2eed84217a3318b4a3bcd7bd99)
Date Fri, 15 Jan 2016 17:05:16 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.6 840535f56 -> cbc3288b5


MAPREDUCE-6554. MRAppMaster servicestart failing with NPE in MRAppMaster#parsePreviousJobHistory.
Contributed by Bibin A Chundatt
(cherry picked from commit 296ecbd5ec9f7d2eed84217a3318b4a3bcd7bd99)

Conflicts:

	hadoop-mapreduce-project/CHANGES.txt


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

Branch: refs/heads/branch-2.6
Commit: cbc3288b554fb2af436a9b92739ed6fd3b58dac9
Parents: 840535f
Author: Jason Lowe <jlowe@apache.org>
Authored: Fri Jan 15 17:04:34 2016 +0000
Committer: Jason Lowe <jlowe@apache.org>
Committed: Fri Jan 15 17:04:34 2016 +0000

----------------------------------------------------------------------
 hadoop-mapreduce-project/CHANGES.txt            |  3 ++
 .../mapreduce/jobhistory/EventReader.java       | 31 +++++++++++++-------
 2 files changed, 23 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/cbc3288b/hadoop-mapreduce-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt
index f7bc95b..514cc44 100644
--- a/hadoop-mapreduce-project/CHANGES.txt
+++ b/hadoop-mapreduce-project/CHANGES.txt
@@ -27,6 +27,9 @@ Release 2.6.4 - UNRELEASED
     MAPREDUCE-6363. [NNBench] Lease mismatch error when running with multiple
     mappers. (Vlad Sharanhovich and Bibin A Chundatt via aajisaka)
 
+    MAPREDUCE-6554. MRAppMaster servicestart failing with NPE in
+    MRAppMaster#parsePreviousJobHistory (Bibin A Chundatt via jlowe)
+
 Release 2.6.3 - 2015-12-17
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/cbc3288b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/EventReader.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/EventReader.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/EventReader.java
index 84743e7..d55f24b 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/EventReader.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/EventReader.java
@@ -20,9 +20,16 @@ package org.apache.hadoop.mapreduce.jobhistory;
 
 import java.io.Closeable;
 import java.io.DataInputStream;
-import java.io.IOException;
 import java.io.EOFException;
+import java.io.IOException;
 
+import org.apache.avro.AvroRuntimeException;
+import org.apache.avro.Schema;
+import org.apache.avro.io.DatumReader;
+import org.apache.avro.io.Decoder;
+import org.apache.avro.io.DecoderFactory;
+import org.apache.avro.specific.SpecificData;
+import org.apache.avro.specific.SpecificDatumReader;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.fs.FileSystem;
@@ -31,13 +38,6 @@ import org.apache.hadoop.mapreduce.CounterGroup;
 import org.apache.hadoop.mapreduce.Counters;
 import org.apache.hadoop.util.StringInterner;
 
-import org.apache.avro.Schema;
-import org.apache.avro.io.Decoder;
-import org.apache.avro.io.DecoderFactory;
-import org.apache.avro.io.DatumReader;
-import org.apache.avro.specific.SpecificData;
-import org.apache.avro.specific.SpecificDatumReader;
-
 @InterfaceAudience.Private
 @InterfaceStability.Unstable
 public class EventReader implements Closeable {
@@ -72,9 +72,18 @@ public class EventReader implements Closeable {
     }
 
     Schema myschema = new SpecificData(Event.class.getClassLoader()).getSchema(Event.class);
-    this.schema = Schema.parse(in.readLine());
-    this.reader = new SpecificDatumReader(schema, myschema);
-    this.decoder = DecoderFactory.get().jsonDecoder(schema, in);
+    String eventschema = in.readLine();
+    if (null != eventschema) {
+      try {
+        this.schema = Schema.parse(eventschema);
+        this.reader = new SpecificDatumReader(schema, myschema);
+        this.decoder = DecoderFactory.get().jsonDecoder(schema, in);
+      } catch (AvroRuntimeException e) {
+        throw new IOException(e);
+      }
+    } else {
+      throw new IOException("Event schema string not parsed since its null");
+    }
   }
   
   /**


Mime
View raw message