예제 #1
0
 /**
  * Call heartbeat check function of HeartbeatManager and get under replicated blocks count within
  * write lock to make sure computeDatanodeWork doesn't interfere.
  *
  * @param namesystem the FSNamesystem
  * @param bm the BlockManager to manipulate
  * @return the number of under replicated blocks
  */
 public static int checkHeartbeatAndGetUnderReplicatedBlocksCount(
     FSNamesystem namesystem, BlockManager bm) {
   namesystem.writeLock();
   try {
     bm.getDatanodeManager().getHeartbeatManager().heartbeatCheck();
     return bm.getUnderReplicatedNotMissingBlocks();
   } finally {
     namesystem.writeUnlock();
   }
 }