hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject hadoop git commit: HDFS-11229. HDFS-11056 failed to close meta file. Contributed by Wei-Chiu Chuang.
Date Sat, 10 Dec 2016 17:34:39 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 deae1f832 -> 2123b664c


HDFS-11229. HDFS-11056 failed to close meta file. Contributed by Wei-Chiu Chuang.

(cherry picked from commit 292bd78b4494ba1a1073b32b3f89d95e72f3204d)
(cherry picked from commit fa3b2bee618c72bae57890f011b475522fe2ff47)


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

Branch: refs/heads/branch-2.7
Commit: 2123b664cadfcb69cdcf838eb95e59b87f174cab
Parents: deae1f832
Author: Wei-Chiu Chuang <weichiu@apache.org>
Authored: Sat Dec 10 09:34:05 2016 -0800
Committer: Wei-Chiu Chuang <weichiu@apache.org>
Committed: Sat Dec 10 09:34:05 2016 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                   | 2 ++
 .../hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java    | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2123b664/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index b962fce..f8fe1e5 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -205,6 +205,8 @@ Release 2.7.4 - UNRELEASED
     HDFS-11180. Intermittent deadlock in NameNode when failover happens.
     (aajisaka)
 
+    HDFS-11229. HDFS-11056 failed to close meta file. (Wei-Chiu Chuang)
+
 Release 2.7.3 - 2016-08-25
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2123b664/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
index 4ad863e..2b121ac 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java
@@ -1097,9 +1097,10 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
     int offsetInChecksum = BlockMetadataHeader.getHeaderSize() +
         (int)(onDiskLen / bytesPerChecksum * checksumSize);
     byte[] lastChecksum = new byte[checksumSize];
-    RandomAccessFile raf = new RandomAccessFile(metaFile, "r");
-    raf.seek(offsetInChecksum);
-    raf.read(lastChecksum, 0, checksumSize);
+    try (RandomAccessFile raf = new RandomAccessFile(metaFile, "r")) {
+      raf.seek(offsetInChecksum);
+      raf.read(lastChecksum, 0, checksumSize);
+    }
     return lastChecksum;
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message