public static String getSubpartitionPath(
            String basePath, TieredStoragePartitionId partitionId, int subpartitionId) {
        while (basePath.endsWith("/") && basePath.length() > 1) {
            basePath = basePath.substring(0, basePath.length() - 1);
        }
        return String.format(
                "%s/%s/%s",
                basePath, TieredStorageIdMappingUtils.convertId(partitionId), subpartitionId);
    }
@Test
    void testGetSubpartitionPath() {
        TieredStoragePartitionId partitionId =
                TieredStorageIdMappingUtils.convertId(new ResultPartitionID());
        int subpartitionId = 0;

        String subpartitionPath =
                SegmentPartitionFile.getSubpartitionPath(
                        tempFolder.getPath(), partitionId, subpartitionId);
        File partitionFile =
                new File(
                        tempFolder.getPath(),
                        TieredStorageIdMappingUtils.convertId(partitionId).toString());
        assertThat(subpartitionPath)
                .isEqualTo(new File(partitionFile, String.valueOf(subpartitionId)).toString());
    }