@Override
    public CompletableFuture<Void> write(
            TieredStoragePartitionId partitionId, List<SubpartitionBufferContext> buffersToWrite) {
        CompletableFuture<Void> flushSuccessNotifier = new CompletableFuture<>();
        ioExecutor.execute(() -> flush(buffersToWrite, flushSuccessNotifier));
        return flushSuccessNotifier;
    }
@Test
    void testWrite() throws IOException {
        int numSubpartitions = 5;
        int numSegments = 10;
        int numBuffersPerSegment = 10;
        int bufferSizeBytes = 3;
        AtomicInteger receivedBuffers = new AtomicInteger(0);
        TestingProducerMergedPartitionFileIndex partitionFileIndex =
                new TestingProducerMergedPartitionFileIndex.Builder()
                        .setIndexFilePath(new File(tempFolder.toFile(), "testIndex").toPath())
                        .setAddBuffersConsumer(buffers -> receivedBuffers.getAndAdd(buffers.size()))
                        .build();

        Path testFile = new File(tempFolder.toFile(), "testFile").toPath();
        ProducerMergedPartitionFileWriter partitionFileWriter =
                new ProducerMergedPartitionFileWriter(testFile, partitionFileIndex);

        // Prepare the buffers to be written
        List<PartitionFileWriter.SubpartitionBufferContext> subpartitionBuffers =
                generateBuffersToWrite(
                        numSubpartitions, numSegments, numBuffersPerSegment, bufferSizeBytes);

        // Write the file
        partitionFileWriter.write(
                TieredStorageIdMappingUtils.convertId(new ResultPartitionID()),
                subpartitionBuffers);
        partitionFileWriter.release();

        // Read the file
        byte[] bytesRead = Files.readAllBytes(testFile);

        int numExpectedBuffers = numSubpartitions * numSegments * numBuffersPerSegment;
        int numExpectedBytes =
                numExpectedBuffers * (BufferReaderWriterUtil.HEADER_LENGTH + bufferSizeBytes);
        assertThat(receivedBuffers).hasValue(numExpectedBuffers);
        assertThat(bytesRead.length).isEqualTo(numExpectedBytes);
    }