code: public void addTempBlockMeta(TempBlockMeta tempBlockMeta) throws WorkerOutOfSpaceException,
        BlockAlreadyExistsException {
      Preconditions.checkNotNull(tempBlockMeta, "tempBlockMeta");
      long sessionId = tempBlockMeta.getSessionId();
      long blockId = tempBlockMeta.getBlockId();
      long blockSize = tempBlockMeta.getBlockSize();
  
      if (getAvailableBytes() < blockSize) {
        throw new WorkerOutOfSpaceException(ExceptionMessage.NO_SPACE_FOR_BLOCK_META, blockId,
            blockSize, getAvailableBytes(), tempBlockMeta.getBlockLocation().tierAlias());
      }
      if (hasTempBlockMeta(blockId)) {
        throw new BlockAlreadyExistsException(ExceptionMessage.ADD_EXISTING_BLOCK, blockId,
            tempBlockMeta.getBlockLocation().tierAlias());
      }
  
      mBlockIdToTempBlockMap.put(blockId, tempBlockMeta);
      Set<Long> sessionTempBlocks = mSessionIdToTempBlockIdsMap.get(sessionId);
      if (sessionTempBlocks == null) {
        mSessionIdToTempBlockIdsMap.put(sessionId, Sets.newHashSet(blockId));
      } else {
        sessionTempBlocks.add(blockId);
      }
      reserveSpace(blockSize, false);
    }
docs: Adds the metadata of a new block into this storage dir.
  
  @param tempBlockMeta the metadata of a temp block to add
  @throws BlockAlreadyExistsException if blockId already exists
  @throws WorkerOutOfSpaceException when not enough space to hold block