code: int getReplication(Block block) {
      BlockInfo storedBlock = blocksMap.getBlockInfo(block);
      INodeFile fileINode = (storedBlock == null) ? null : storedBlock.getINode();
      if (fileINode == null) { // block does not belong to any file
        return 0;
      }
      assert !fileINode.isDirectory() : "Block cannot belong to a directory.";
      return fileINode.getBlockReplication(storedBlock);
    }
docs: /* get replication factor of a block