hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject [17/50] [abbrv] hadoop git commit: HDFS-11229. HDFS-11056 failed to close meta file. Contributed by Wei-Chiu Chuang.
Date Thu, 15 Dec 2016 09:04:45 GMT
HDFS-11229. HDFS-11056 failed to close meta file. Contributed by Wei-Chiu Chuang.


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

Branch: refs/heads/HDFS-10285
Commit: 2a28e8cf0469a373a99011f0fa540474e60528c8
Parents: b606e02
Author: Wei-Chiu Chuang <weichiu@apache.org>
Authored: Fri Dec 9 16:02:42 2016 -0800
Committer: Wei-Chiu Chuang <weichiu@apache.org>
Committed: Fri Dec 9 16:02:42 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2a28e8cf/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
index 08564de..97bb09b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java
@@ -1132,9 +1132,10 @@ public class FsVolumeImpl implements FsVolumeSpi {
     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