jojochuang commented on code in PR #4322:
URL: https://github.com/apache/hadoop/pull/4322#discussion_r909043772
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -1763,7 +1773,21 @@ public BlocksWithLocations getBlocksWithLocations(final
DatanodeID datanode,
void removeBlocksAssociatedTo(final DatanodeDescriptor node) {
providedStorageMap.removeDatanode(node);
final Iterator<BlockInfo> it = node.getBlockIterator();
+ int numBlocksRemovedPerLock = 0;
while(it.hasNext()) {
+ if (numBlocksRemovedPerLock >= numBlocksPerRemove) {
+ namesystem.writeUnlock();
+ try {
+ LOG.debug("Yielded lock during removing blocks associated to the
dead datanode"); //释放锁,并sleep 500ns(1 ns = 10-9 s)
Review Comment:
Please use English for comments.
--
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]