prasad-acit commented on a change in pull request #3201:
URL: https://github.com/apache/hadoop/pull/3201#discussion_r671996972



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
##########
@@ -1860,6 +1928,55 @@ 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());
+    INode inode = new INodeWithAdditionalFields(id, null,
+        new PermissionStatus("", "", new FsPermission((short) 0)), 0, 0) {

Review comment:
       PermissionStatus - a static object can be used here instead of creating 
new one for every call.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
##########
@@ -1860,6 +1928,55 @@ 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());
+    INode inode = new INodeWithAdditionalFields(id, null,

Review comment:
       I think we can use INodeFile / Directory, instead of having anonymous 
implementation here.
   equals & hashcode just depend on the inode id, so it shouldnt have any issue.




-- 
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