hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject [25/50] hadoop git commit: MAPREDUCE-6045. need close the DataInputStream after open it in TestMapReduce.java (zxu via rkanter)
Date Wed, 24 Dec 2014 19:35:39 GMT
MAPREDUCE-6045. need close the DataInputStream after open it in TestMapReduce.java (zxu via
rkanter)


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

Branch: refs/heads/HDFS-EC
Commit: e7c75bf0abdfc48f8904072c8f864986c82f428c
Parents: 480d4ea
Author: Robert Kanter <rkanter@apache.org>
Authored: Fri Dec 19 11:59:22 2014 -0800
Committer: Zhe Zhang <zhezhang@cloudera.com>
Committed: Wed Dec 24 11:22:16 2014 -0800

----------------------------------------------------------------------
 hadoop-mapreduce-project/CHANGES.txt                    |  3 +++
 .../java/org/apache/hadoop/mapreduce/TestMapReduce.java | 12 ++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e7c75bf0/hadoop-mapreduce-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt
index 41fdb4f..18270f68 100644
--- a/hadoop-mapreduce-project/CHANGES.txt
+++ b/hadoop-mapreduce-project/CHANGES.txt
@@ -285,6 +285,9 @@ Release 2.7.0 - UNRELEASED
     MAPREDUCE-6166. Reducers do not validate checksum of map outputs when
     fetching directly to disk. (Eric Payne via gera)
 
+    MAPREDUCE-6045. need close the DataInputStream after open it in
+    TestMapReduce.java (zxu via rkanter)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e7c75bf0/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapReduce.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapReduce.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapReduce.java
index 48ad47a..912f0e3 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapReduce.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMapReduce.java
@@ -465,11 +465,15 @@ public class TestMapReduce {
   private static boolean isSequenceFile(FileSystem fs,
                                         Path f) throws IOException {
     DataInputStream in = fs.open(f);
-    byte[] seq = "SEQ".getBytes();
-    for(int i=0; i < seq.length; ++i) {
-      if (seq[i] != in.read()) {
-        return false;
+    try {
+      byte[] seq = "SEQ".getBytes();
+      for (int i = 0; i < seq.length; ++i) {
+        if (seq[i] != in.read()) {
+          return false;
+        }
       }
+    } finally {
+      in.close();
     }
     return true;
   }


Mime
View raw message