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 00:14:36 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 983d487e9 -> fa3b2bee6


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

(cherry picked from commit 292bd78b4494ba1a1073b32b3f89d95e72f3204d)


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

Branch: refs/heads/branch-2.8
Commit: fa3b2bee618c72bae57890f011b475522fe2ff47
Parents: 983d487
Author: Wei-Chiu Chuang <weichiu@apache.org>
Authored: Fri Dec 9 16:07:56 2016 -0800
Committer: Wei-Chiu Chuang <weichiu@apache.org>
Committed: Fri Dec 9 16:12:09 2016 -0800

----------------------------------------------------------------------
 .../hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/fa3b2bee/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 c2efb4d..6c48abb 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
@@ -1186,9 +1186,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