diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index bc09fc4e0f6..ccc6fe40657 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -275,6 +275,8 @@ Release 2.0.0 - UNRELEASED HDFS-3322. Use HdfsDataInputStream and HdfsDataOutputStream in Hdfs. (szetszwo) + HDFS-3339. Change INode to package private. (John George via szetszwo) + OPTIMIZATIONS HDFS-2477. Optimize computing the diff between a block report and the diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java index 28c0cb1f5f3..2acbd9448b1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java @@ -57,7 +57,6 @@ import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.BlockUCState; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.ReplicaState; import org.apache.hadoop.hdfs.server.common.Util; import org.apache.hadoop.hdfs.server.namenode.FSClusterStats; -import org.apache.hadoop.hdfs.server.namenode.INode; import org.apache.hadoop.hdfs.server.namenode.INodeFile; import org.apache.hadoop.hdfs.server.namenode.INodeFileUnderConstruction; import org.apache.hadoop.hdfs.server.namenode.NameNode; @@ -2382,7 +2381,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block // necessary. In that case, put block on a possibly-will- // be-replicated list. // - INode fileINode = blocksMap.getINode(block); + INodeFile fileINode = blocksMap.getINode(block); if (fileINode != null) { namesystem.decrementSafeBlockCount(block); updateNeededReplications(block, -1, 0); @@ -2614,7 +2613,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block NumberReplicas num) { int curReplicas = num.liveReplicas(); int curExpectedReplicas = getReplication(block); - INode fileINode = blocksMap.getINode(block); + INodeFile fileINode = blocksMap.getINode(block); Iterator nodeIter = blocksMap.nodeIterator(block); StringBuilder nodeList = new StringBuilder(); while (nodeIter.hasNext()) { @@ -2665,7 +2664,7 @@ assert storedBlock.findDatanode(dn) < 0 : "Block " + block final Iterator it = srcNode.getBlockIterator(); while(it.hasNext()) { final Block block = it.next(); - INode fileINode = blocksMap.getINode(block); + INodeFile fileINode = blocksMap.getINode(block); if (fileINode != null) { NumberReplicas num = countNodes(block); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INode.java index c4bc1cc4646..cdad315f7a4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INode.java @@ -20,6 +20,7 @@ package org.apache.hadoop.hdfs.server.namenode; import java.util.Arrays; import java.util.List; +import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.fs.ContentSummary; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; @@ -34,7 +35,8 @@ import org.apache.hadoop.util.StringUtils; * This is a base INode class containing common fields for file and * directory inodes. */ -public abstract class INode implements Comparable, FSInodeInfo { +@InterfaceAudience.Private +abstract class INode implements Comparable, FSInodeInfo { /* * The inode name is in java UTF8 encoding; * The name in HdfsFileStatus should keep the same encoding as this.