@Internal public class TransactionalIdsGenerator extends Object
It guarantees that:
In other words, any particular generated id will always be assigned to one and only one subtask.
| 构造器和说明 |
|---|
TransactionalIdsGenerator(String prefix,
int subtaskIndex,
int totalNumberOfSubtasks,
int poolSize,
int safeScaleDownFactor) |
| 限定符和类型 | 方法和说明 |
|---|---|
Set<String> |
generateIdsToAbort()
If we have to abort previous transactional id in case of restart after a failure BEFORE first
checkpoint completed, we don't know what was the parallelism used in previous attempt.
|
Set<String> |
generateIdsToUse(long nextFreeTransactionalId)
Range of available transactional ids to use is: [nextFreeTransactionalId,
nextFreeTransactionalId + parallelism * kafkaProducersPoolSize) loop below picks in a
deterministic way a subrange of those available transactional ids based on index of this
subtask.
|
public TransactionalIdsGenerator(String prefix, int subtaskIndex, int totalNumberOfSubtasks, int poolSize, int safeScaleDownFactor)
public Set<String> generateIdsToUse(long nextFreeTransactionalId)
public Set<String> generateIdsToAbort()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.