public class TransactionalIdsGenerator extends Object
It guarantees that:
Constructor and Description |
---|
TransactionalIdsGenerator(String prefix,
int subtaskIndex,
int totalNumberOfSubtasks,
int poolSize,
int safeScaleDownFactor) |
Modifier and Type | Method and Description |
---|---|
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–2018 The Apache Software Foundation. All rights reserved.