code: public void commitTempBlockMeta(TempBlockMeta tempBlockMeta)
        throws WorkerOutOfSpaceException, BlockAlreadyExistsException, BlockDoesNotExistException {
      long blockId = tempBlockMeta.getBlockId();
      if (hasBlockMeta(blockId)) {
        BlockMeta blockMeta = getBlockMeta(blockId);
        throw new BlockAlreadyExistsException(ExceptionMessage.ADD_EXISTING_BLOCK.getMessage(blockId,
            blockMeta.getBlockLocation().tierAlias()));
      }
      BlockMeta block = new BlockMeta(Preconditions.checkNotNull(tempBlockMeta));
      StorageDir dir = tempBlockMeta.getParentDir();
      dir.removeTempBlockMeta(tempBlockMeta);
      dir.addBlockMeta(block);
    }
docs: Commits a temp block.
  
  @param tempBlockMeta the metadata of the temp block to commit
  @throws WorkerOutOfSpaceException when no more space left to hold the block
  @throws BlockAlreadyExistsException when the block already exists in committed blocks
  @throws BlockDoesNotExistException when temp block can not be found