public Map<TopicRange, MessageId> snapshotCurrentState() {
        // this method assumes that the checkpoint lock is held
        assert Thread.holdsLock(checkpointLock);

        Map<TopicRange, MessageId> state = new HashMap<>(subscribedPartitionStates.size());

        for (PulsarTopicState pa : subscribedPartitionStates) {
            state.put(pa.getTopicRange(), pa.getOffset());
        }
        return state;
    }
Takes a snapshot of the partition offsets.

<p>Important: This method must be called under the checkpoint lock.

@return A map from partition to current offset.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/pulsar/src/main/java/org/apache/inlong/sort/pulsar/internal/PulsarFetcher.java