xinglin commented on a change in pull request #3201:
URL: https://github.com/apache/hadoop/pull/3201#discussion_r671915682
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeMap.java
##########
@@ -284,8 +287,49 @@ public byte getLocalStoragePolicyID() {
return HdfsConstants.BLOCK_STORAGE_POLICY_ID_UNSPECIFIED;
}
};
+
+ /*
+ * Iterate all partitions of PGSet and return the INode.
+ * Just for fallback.
+ */
+ PermissionStatus perm =
+ new PermissionStatus("", "", new FsPermission((short) 0));
+ // TODO: create a static array, to avoid creation of keys each time.
+ for (int p = 0; p < NUM_RANGES_STATIC; p++) {
+ INodeDirectory key = new INodeDirectory(
+ INodeId.ROOT_INODE_ID, "range key".getBytes(), perm, 0);
Review comment:
@prasad-acit the code is correct: here we want to get and iterate all
the partitions. Thus, we create NUM_RANGES_STATIC inodes, with the inode number
set to ROOT_INODE and its parent set from [0, NUM_RANGES_STATIC-1). With that,
we can get each partition. Then, within each partition, we look for the inode
we are interested in. This section of code is similar as code section from line
204-209 in the same file, where we initialize the partitions.
--
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]