code: public static String tempPath(StorageDir dir, long sessionId, long blockId) {
      final String tmpDir = ServerConfiguration.get(PropertyKey.WORKER_DATA_TMP_FOLDER);
      final int subDirMax = ServerConfiguration.getInt(PropertyKey.WORKER_DATA_TMP_SUBDIR_MAX);
  
      return PathUtils.concatPath(dir.getDirPath(), tmpDir, sessionId % subDirMax,
          String.format("%x-%x", sessionId, blockId));
    }
docs: All blocks are created as temp blocks before committed. They are stored in BlockStore under a
  subdir of its {@link StorageDir}, the subdir is tmpFolder/sessionId % maxSubdirMax.
  tmpFolder is a property of {@link PropertyKey#WORKER_DATA_TMP_FOLDER}.
  maxSubdirMax is a property of {@link PropertyKey#WORKER_DATA_TMP_SUBDIR_MAX}.
  The block file name is "sessionId-blockId". e.g. sessionId 2 creates a temp Block 100 in
  {@link StorageDir} "/mnt/mem/0", this temp block has path:
  <p>
  /mnt/mem/0/.tmp_blocks/2/2-100
  
  @param dir the parent directory
  @param sessionId the session id
  @param blockId the block id
  @return temp file path