forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EXT] Fix repeated batch after stop gracefully
- Loading branch information
Showing
2 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,7 +209,14 @@ class JobGenerator(jobScheduler: JobScheduler) extends Logging { | |
|
||
// Batches when the master was down, that is, | ||
// between the checkpoint and current restart time | ||
val checkpointTime = ssc.initialCheckpoint.checkpointTime | ||
val checkpointTime = { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
// if checkpoint after batch completion, start from next batch | ||
if (ssc.initialCheckpoint.afterBatchCompletion) { | ||
ssc.initialCheckpoint.checkpointTime + batchDuration | ||
} else { | ||
ssc.initialCheckpoint.checkpointTime | ||
} | ||
} | ||
This comment has been minimized.
Sorry, something went wrong. |
||
val restartTime = new Time(timer.getRestartTime(graph.zeroTime.milliseconds)) | ||
val downTimes = checkpointTime.until(restartTime, batchDuration) | ||
logInfo("Batches during down time (" + downTimes.size + " batches): " | ||
|
@@ -292,7 +299,7 @@ class JobGenerator(jobScheduler: JobScheduler) extends Logging { | |
if (shouldCheckpoint && (time - graph.zeroTime).isMultipleOf(ssc.checkpointDuration)) { | ||
logInfo("Checkpointing graph for time " + time) | ||
ssc.graph.updateCheckpointData(time) | ||
checkpointWriter.write(new Checkpoint(ssc, time), clearCheckpointDataLater) | ||
checkpointWriter.write(new Checkpoint(ssc, time, clearCheckpointDataLater), clearCheckpointDataLater) | ||
This comment has been minimized.
Sorry, something went wrong.
jerryshao
|
||
} | ||
} | ||
|
||
|
don't need
{
here.