public boolean addToCorruptReplicasMap ( Block blk , DatanodeDescriptor dn ) { Collection < DatanodeDescriptor > nodes = getNodes ( blk ) ; if ( nodes == null ) { nodes = new TreeSet < DatanodeDescriptor > ( ) ; corruptReplicasMap . put ( blk , nodes ) ; } boolean added = false ; if ( ! nodes . contains ( dn ) ) { added = nodes . add ( dn ) ; NameNode . stateChangeLog . info ( "BLOCK NameSystem.addToCorruptReplicasMap: " + blk . getBlockName ( ) + " added as corrupt on " + dn . getName ( ) + " by " + Server . getRemoteIp ( ) ) ; } else { NameNode . stateChangeLog . info ( "BLOCK NameSystem.addToCorruptReplicasMap: " + "duplicate requested for " + blk . getBlockName ( ) + " to add as corrupt " + "on " + dn . getName ( ) + " by " + Server . getRemoteIp ( ) ) ; } return added ; }
Mark the block belonging to datanode as corrupt .