code: public void addBlockMeta(BlockMeta blockMeta) throws WorkerOutOfSpaceException,
        BlockAlreadyExistsException {
      Preconditions.checkNotNull(blockMeta, "blockMeta");
      long blockId = blockMeta.getBlockId();
      long blockSize = blockMeta.getBlockSize();
  
      if (getAvailableBytes() < blockSize) {
        throw new WorkerOutOfSpaceException(ExceptionMessage.NO_SPACE_FOR_BLOCK_META, blockId,
            blockSize, getAvailableBytes(), blockMeta.getBlockLocation().tierAlias());
      }
      if (hasBlockMeta(blockId)) {
        throw new BlockAlreadyExistsException(ExceptionMessage.ADD_EXISTING_BLOCK, blockId, blockMeta
            .getBlockLocation().tierAlias());
      }
      mBlockIdToBlockMap.put(blockId, blockMeta);
      reserveSpace(blockSize, true);
    }
docs: Adds the metadata of a new block into this storage dir.
  
  @param blockMeta the metadata of the block
  @throws BlockAlreadyExistsException if blockId already exists
  @throws WorkerOutOfSpaceException when not enough space to hold block