this.topicPartition = topicPartition;
this.offset = offset;
this.startTime = clock.instant();
- this.timeNextRetryIsDue = this.startTime;
log.info(
"{} - Back-Off requested for offset={} in {}",
boolean isWaitingForNextRetry()
{
- if (backOffExecution == null)
+ if (timeNextRetryIsDue == null)
{
return false;
}
boolean isStarted(long offset)
{
- return this.offset == offset && timeNextRetryIsDue != null;
+ return this.offset == offset && backOffExecution != null;
}
boolean isCompleted()
{
- return backOffExecution == null && timeNextRetryIsDue != null;
+ return timeNextRetryIsDue == null;
}
void markAsCompleted()
{
- if (backOffExecution != null)
+ if (timeNextRetryIsDue != null)
{
log.info(
"{} - {}. retry for offset={} in {} succeeded after {}",
topicPartition,
Duration.between(startTime, timeNextRetryIsDue));
- backOffExecution = null;
timeNextRetryIsDue = null;
}
}
if (backOffMillis == BackOffExecution.STOP)
{
- backOffExecution = null;
+ timeNextRetryIsDue = null;
}
else
{