Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ class StreamExecution(
availableOffsets = nextOffsets.toStreamProgress(sources)
/* Initialize committed offsets to a committed batch, which at this
* is the second latest batch id in the offset log. */
offsetLog.get(latestBatchId - 1).foreach { secondLatestBatchId =>
offsetLog.get(latestBatchId - 1).getOrElse {
throw new IllegalStateException(s"batch $latestBatchId doesn't exist")
}.foreach { secondLatestBatchId =>
committedOffsets = secondLatestBatchId.toStreamProgress(sources)
}

Expand Down Expand Up @@ -565,7 +567,9 @@ class StreamExecution(

// Now that we've updated the scheduler's persistent checkpoint, it is safe for the
// sources to discard data from the previous batch.
val prevBatchOff = offsetLog.get(currentBatchId - 1)
val prevBatchOff = offsetLog.get(currentBatchId - 1).getOrElse {
throw new IllegalStateException(s"batch $currentBatchId doesn't exist")
}
if (prevBatchOff.isDefined) {
prevBatchOff.get.toStreamProgress(sources).foreach {
case (src, off) => src.commit(off)
Expand Down