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 gi...@apache.org on 2018/11/30 19:07:45 UTC
hadoop git commit: HDFS-14105. Replace TreeSet in NamenodeFsck with
HashSet. Contributed by Beluga Behr.
Repository: hadoop
Updated Branches:
refs/heads/trunk b09cfad43 -> 99e201dfe
HDFS-14105. Replace TreeSet in NamenodeFsck with HashSet. Contributed by Beluga Behr.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/99e201df
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/99e201df
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/99e201df
Branch: refs/heads/trunk
Commit: 99e201dfe2295be830efcc80be34706802da30be
Parents: b09cfad
Author: Giovanni Matteo Fumarola <gi...@apache.org>
Authored: Fri Nov 30 11:07:11 2018 -0800
Committer: Giovanni Matteo Fumarola <gi...@apache.org>
Committed: Fri Nov 30 11:07:11 2018 -0800
----------------------------------------------------------------------
.../hadoop/hdfs/server/namenode/NamenodeFsck.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/99e201df/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
index b4c0a93..095a6ff 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
@@ -30,10 +30,11 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.TreeSet;
+import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import org.apache.commons.io.IOUtils;
@@ -1021,10 +1022,10 @@ public class NamenodeFsck implements DataEncryptionKeyFactory {
* around.
*/
private void copyBlock(final DFSClient dfs, LocatedBlock lblock,
- OutputStream fos) throws Exception {
+ OutputStream fos) throws Exception {
int failures = 0;
InetSocketAddress targetAddr = null;
- TreeSet<DatanodeInfo> deadNodes = new TreeSet<DatanodeInfo>();
+ Set<DatanodeInfo> deadNodes = new HashSet<DatanodeInfo>();
BlockReader blockReader = null;
ExtendedBlock block = lblock.getBlock();
@@ -1132,9 +1133,8 @@ public class NamenodeFsck implements DataEncryptionKeyFactory {
* That's the local one, if available.
*/
private DatanodeInfo bestNode(DFSClient dfs, DatanodeInfo[] nodes,
- TreeSet<DatanodeInfo> deadNodes) throws IOException {
- if ((nodes == null) ||
- (nodes.length - deadNodes.size() < 1)) {
+ Set<DatanodeInfo> deadNodes) throws IOException {
+ if ((nodes == null) || (nodes.length - deadNodes.size() < 1)) {
throw new IOException("No live nodes contain current block");
}
DatanodeInfo chosenNode;
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org