code: private void abortBlockInternal(long sessionId, long blockId) throws BlockDoesNotExistException,
        BlockAlreadyExistsException, InvalidWorkerStateException, IOException {
  
      String path;
      TempBlockMeta tempBlockMeta;
      try (LockResource r = new LockResource(mMetadataReadLock)) {
        checkTempBlockOwnedBySession(sessionId, blockId);
        tempBlockMeta = mMetaManager.getTempBlockMeta(blockId);
        path = tempBlockMeta.getPath();
      }
  
      // The metadata lock is released during heavy IO. The temp block is private to one session, so
      // we do not lock it.
      Files.delete(Paths.get(path));
  
      try (LockResource r = new LockResource(mMetadataWriteLock)) {
        mMetaManager.abortTempBlockMeta(tempBlockMeta);
      } catch (BlockDoesNotExistException e) {
        throw Throwables.propagate(e); // We shall never reach here
      }
    }
docs: Aborts a temp block.
  
  @param sessionId the id of session
  @param blockId the id of block
  @throws BlockDoesNotExistException if block id can not be found in temporary blocks
  @throws BlockAlreadyExistsException if block id already exists in committed blocks
  @throws InvalidWorkerStateException if block id is not owned by session id