xinglin commented on a change in pull request #3201:
URL: https://github.com/apache/hadoop/pull/3201#discussion_r675869638



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
##########
@@ -1475,6 +1486,26 @@ void addYieldCount(long value) {
   public INodeMap getINodeMap() {
     return inodeMap;
   }
+  public GSet<INode, INodeWithAdditionalFields> getTempINodeMap() {

Review comment:
       It turns out this function is not used at all!!!  Removed. 

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
##########
@@ -1860,6 +1928,21 @@ FSPermissionChecker getPermissionChecker()
     }
   }
 
+  public INode getInode(INode inode) {
+    return inodeMap.get(inode);
+  }
+  public INode getInodeFromTempINodeMap(long id) {
+    LOG.debug("getInodeFromTempINodeMap: id={}, TempINodeMap.size={}",
+        id, inodeMapTemp.size());
+    /*
+     * Convert a long inode id into an INode object. We only need to compare
+     * two inodes by inode id. So, it can be any type of INode object.
+     */
+    INode inode = new INodeDirectory(id, null,

Review comment:
       GSet<K, V> requires V to be extended from K. Thus, we replaced 
GSet<Inode, InodeWithAdditionalFields> with HashMap<Long, 
InodeWithAdditionalFields>. 
   
   

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
##########
@@ -160,6 +164,8 @@ private static INodeDirectory createRoot(FSNamesystem 
namesystem) {
   private final int contentCountLimit; // max content summary counts per run
   private final long contentSleepMicroSec;
   private final INodeMap inodeMap; // Synchronized by dirLock
+  // Temp InodeMap used when loading an FS image.
+  private final GSet<INode, INodeWithAdditionalFields> inodeMapTemp;

Review comment:
       agreed to stay as it is, as the proposed change would require changes to 
dozens of functions across three files.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to