xinglin commented on pull request #3351:
URL: https://github.com/apache/hadoop/pull/3351#issuecomment-915436686
If we want to add support dynamic/variable partition numbers, we need to
modify this function as well in INode.java.
idx here is the partition id. it is modulo by INodeMap.NUM_RANGES_STATIC.
```
public static long indexOf(long[] key) {
if(key[key.length-1] == INodeId.ROOT_INODE_ID) {
return key[0];
}
long idx = LARGE_PRIME * key[0];
idx = (idx ^ (idx >> 32)) & (INodeMap.NUM_RANGES_STATIC -1);
return idx;
}
```
--
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]