Skip to content
Closed
Show file tree
Hide file tree
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 @@ -145,10 +145,16 @@ class FileStreamSource(

if (batchFiles.nonEmpty) {
metadataLogCurrentOffset += 1
metadataLog.add(metadataLogCurrentOffset, batchFiles.map { case (p, timestamp) =>

val fileEntries = batchFiles.map { case (p, timestamp) =>
FileEntry(path = p, timestamp = timestamp, batchId = metadataLogCurrentOffset)
}.toArray)
logInfo(s"Log offset set to $metadataLogCurrentOffset with ${batchFiles.size} new files")
}.toArray
if (metadataLog.add(metadataLogCurrentOffset, fileEntries)) {
logInfo(s"Log offset set to $metadataLogCurrentOffset with ${batchFiles.size} new files")
} else {
throw new IllegalStateException("Concurrent update to the log. Multiple streaming jobs " +
s"detected for $metadataLogCurrentOffset")
}
}

FileStreamSourceOffset(metadataLogCurrentOffset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,9 @@ class MicroBatchExecution(
withProgressLocked {
sinkCommitProgress = batchSinkProgress
watermarkTracker.updateWatermark(lastExecution.executedPlan)
commitLog.add(currentBatchId, CommitMetadata(watermarkTracker.currentWatermark))
assert(commitLog.add(currentBatchId, CommitMetadata(watermarkTracker.currentWatermark)),
"Concurrent update to the commit log. Multiple streaming jobs detected for " +
s"$currentBatchId")
committedOffsets ++= availableOffsets
}
logDebug(s"Completed batch ${currentBatchId}")
Expand Down