code: public void closeReaderOrWriter(long sessionId, long blockId) throws IOException {
      BlockInfo blockInfo;
      try (LockResource lr = new LockResource(mLock)) {
        blockInfo = mBlocks.get(new Key(sessionId, blockId));
        if (blockInfo == null) {
          LOG.warn("Key (block ID: {}, session ID {}) is not found when cleaning up the UFS block.",
              blockId, sessionId);
          return;
        }
      }
      blockInfo.closeReaderOrWriter();
    }
docs: Closes the block reader or writer and checks whether it is necessary to commit the block
  to Local block store.
  
  During UFS block read, this is triggered when the block is unlocked.
  During UFS block write, this is triggered when the UFS block is committed.
  
  @param sessionId the session ID
  @param blockId the block ID