public void scanPartitions(Consumer<Tuple2<?, RowData>> consumer) throws IOException {
        DataOutputSerializer outputBuffer = new DataOutputSerializer(4096);
        for (String partition : allPartition) {
            StringSerializer.INSTANCE.serialize(partition, outputBuffer);
            try (Stream<? extends Tuple2<?, RowData>> stream = buffer.scan(outputBuffer.getCopyOfBuffer())) {
                stream.forEach(consumer);
            }
            outputBuffer.clear();
        }
    }
A buffer that stores data grouped according to partition information, and caches data for
one checkpoint cycle each time.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/collections/PartitionGroupBuffer.java