class BlockManagerSafeMode {

  synchronized void incrementSafeBlockCount(int storageNum,
      BlockInfo storedBlock) {
    assert namesystem.hasWriteLock();
    if (status == BMSafeModeStatus.OFF) {
      return;
    }

    final int safe = storedBlock.isStriped() ?
        ((BlockInfoStriped)storedBlock).getRealDataBlockNum() : safeReplication;
    if (storageNum == safe) {
      this.blockSafe++;

      // Report startup progress only if we haven't completed startup yet.
      StartupProgress prog = NameNode.getStartupProgress();
      if (prog.getStatus(Phase.SAFEMODE) != Status.COMPLETE) {
        if (this.awaitingReportedBlocksCounter == null) {
          this.awaitingReportedBlocksCounter = prog.getCounter(Phase.SAFEMODE,
              STEP_AWAITING_REPORTED_BLOCKS);
        }
        this.awaitingReportedBlocksCounter.increment();
      }

      checkSafeMode();
    }
  }

    BlockManagerSafeMode(BlockManager blockManager, Namesystem namesystem,
      Configuration conf);

}