You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ae...@apache.org on 2018/03/15 17:49:41 UTC
[18/22] hadoop git commit: HDFS-13246. FileInputStream redundant
closes in readReplicasFromCache. Contributed by liaoyuxiangqin.
HDFS-13246. FileInputStream redundant closes in readReplicasFromCache. Contributed by liaoyuxiangqin.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5ff22d4c
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5ff22d4c
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5ff22d4c
Branch: refs/heads/HDFS-7240
Commit: 5ff22d4c3a417292c496a4bb02e8b19fad66ec63
Parents: 3a0f4bc
Author: Xiao Chen <xi...@apache.org>
Authored: Wed Mar 14 21:59:26 2018 -0700
Committer: Xiao Chen <xi...@apache.org>
Committed: Wed Mar 14 21:59:51 2018 -0700
----------------------------------------------------------------------
.../hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/5ff22d4c/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java
index 2d0c6ea..3f9de78 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java
@@ -812,7 +812,6 @@ class BlockPoolSlice {
break;
}
}
- inputStream.close();
// Now it is safe to add the replica into volumeMap
// In case of any exception during parsing this cache file, fall back
// to scan all the files on disk.
@@ -835,12 +834,13 @@ class BlockPoolSlice {
return false;
}
finally {
+ // close the inputStream
+ IOUtils.closeStream(inputStream);
+
if (!fileIoProvider.delete(volume, replicaFile)) {
LOG.info("Failed to delete replica cache file: " +
replicaFile.getPath());
}
- // close the inputStream
- IOUtils.closeStream(inputStream);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org