code: @Override
    public void cleanupSession(long sessionId) {
      Set<Long> blockIds;
      try (LockResource lr = new LockResource(mLock)) {
        blockIds = mSessionIdToBlockIds.get(sessionId);
        if (blockIds == null) {
          return;
        }
      }
      // Note that, there can be a race condition that blockIds can be stale when we release the
      // access. The race condition only has a minimal negative consequence (printing extra logging
      // message), and is expected very rare to trigger.
      for (Long blockId : blockIds) {
        try {
          // Note that we don't need to explicitly call abortBlock to cleanup the temp block
          // in Local block store because they will be cleanup by the session cleaner in the
          // Local block store.
          closeReaderOrWriter(sessionId, blockId);
          releaseAccess(sessionId, blockId);
        } catch (Exception e) {
          LOG.warn("Failed to cleanup UFS block {}, session {}.", blockId, sessionId);
        }
      }
    }
docs: Cleans up all the block information(e.g. block reader/writer) that belongs to this session.
  
  @param sessionId the session ID