use of org.apache.flink.connector.pulsar.source.reader.fetcher.PulsarUnorderedFetcherManager in project flink by apache.
the class PulsarUnorderedSourceReader method snapshotState.
@Override
public List<PulsarPartitionSplit> snapshotState(long checkpointId) {
LOG.debug("Trigger the new transaction for downstream readers.");
List<PulsarPartitionSplit> splits = ((PulsarUnorderedFetcherManager<OUT>) splitFetcherManager).snapshotState(checkpointId);
if (coordinatorClient != null) {
// Snapshot the transaction status and commit it after checkpoint finished.
List<TxnID> txnIDs = transactionsToCommit.computeIfAbsent(checkpointId, id -> new ArrayList<>());
for (PulsarPartitionSplit split : splits) {
TxnID uncommittedTransactionId = split.getUncommittedTransactionId();
if (uncommittedTransactionId != null) {
txnIDs.add(uncommittedTransactionId);
}
}
}
return splits;
}
Aggregations