Skip to content

Commit

Permalink
Remove IngestJob from ingestFinishedStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
patchwork01 committed Dec 18, 2024
1 parent 7f3f94d commit 8f6d452
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ record = reader.read();
.taskId(taskId)
.startedStatus(ingestAcceptedStatus(ingestJob, validationTime))
.statusUpdate(validatedIngestStartedStatus(ingestJob, startTime))
.finishedStatus(ingestFinishedStatus(ingestJob,
.finishedStatus(ingestFinishedStatus(
summary(startTime, endTime, 200, 200), 1))
.build()));
}
Expand Down Expand Up @@ -272,8 +272,8 @@ record = reader.read();
.taskId(taskId)
.startedStatus(ingestAcceptedStatus(ingestJob, validationTime))
.statusUpdate(validatedIngestStartedStatus(ingestJob, startTime))
.finishedStatus(ingestFinishedStatus(ingestJob,
summary(startTime, endTime, 100, 100), 1))
.finishedStatus(ingestFinishedStatus(summary(startTime, endTime, 100, 100),
1))
.build()));
}

Expand Down Expand Up @@ -314,8 +314,8 @@ void shouldImportDataMultiplePartitions(BulkImportJobRunner runner) throws IOExc
.taskId(taskId)
.startedStatus(ingestAcceptedStatus(ingestJob, validationTime))
.statusUpdate(validatedIngestStartedStatus(ingestJob, startTime))
.finishedStatus(ingestFinishedStatus(ingestJob,
summary(startTime, endTime, 200, 200), 2))
.finishedStatus(ingestFinishedStatus(summary(startTime, endTime, 200, 200),
2))
.build()));
}

Expand Down Expand Up @@ -385,8 +385,8 @@ record = reader.read();
.taskId(taskId)
.startedStatus(ingestAcceptedStatus(ingestJob, validationTime))
.statusUpdate(validatedIngestStartedStatus(ingestJob, startTime))
.finishedStatus(ingestFinishedStatus(ingestJob,
summary(startTime, endTime, 100000, 100000), 50))
.finishedStatus(ingestFinishedStatus(summary(startTime, endTime, 100000, 100000),
50))
.build()));
}

Expand Down Expand Up @@ -422,8 +422,8 @@ void shouldNotThrowExceptionIfProvidedWithDirectoryWhichContainsParquetAndNonPar
.taskId(taskId)
.startedStatus(ingestAcceptedStatus(ingestJob, validationTime))
.statusUpdate(validatedIngestStartedStatus(ingestJob, startTime))
.finishedStatus(ingestFinishedStatus(ingestJob,
summary(startTime, endTime, 200, 200), 1))
.finishedStatus(ingestFinishedStatus(summary(startTime, endTime, 200, 200),
1))
.build()));
}

Expand Down Expand Up @@ -473,8 +473,8 @@ record = reader.read();
.taskId(taskId)
.startedStatus(ingestAcceptedStatus(ingestJob, validationTime))
.statusUpdate(validatedIngestStartedStatus(ingestJob, startTime))
.finishedStatus(ingestFinishedStatus(ingestJob,
summary(startTime, endTime, 200, 200), 1))
.finishedStatus(ingestFinishedStatus(summary(startTime, endTime, 200, 200),
1))
.build()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void shouldReportJobFinished() throws Exception {
.taskId("test-task")
.startedStatus(ingestAcceptedStatus(ingestJob, validationTime))
.statusUpdate(validatedIngestStartedStatus(ingestJob, startTime))
.finishedStatus(ingestFinishedStatus(ingestJob,
.finishedStatus(ingestFinishedStatus(
summary(startTime, finishTime, 100, 100), 1))
.build()));
assertThat(stateStore.getFileReferences())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ private IngestJobAddedFilesStatus filesAddedStatusUpdate(Instant writtenTime, in
}

private IngestJobFinishedStatus finishedStatusUpdate(Instant startTime, Instant finishTime) {
return IngestJobStatusTestHelper.ingestFinishedStatus(job, summary(startTime, finishTime), 2);
return IngestJobStatusTestHelper.ingestFinishedStatus(summary(startTime, finishTime), 2);
}

private IngestJobFinishedStatus finishedStatusUpdateExpectingFileCommits(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,13 @@ public static IngestJobAddedFilesStatus ingestAddedFilesStatus(Instant writtenTi

/**
* Creates an ingest job finished status where files are committed.
*
* @param job the ingest job
*
* @param summary the summary
* @param numFilesWrittenByJob the number of files written by the job
*
* @return an ingest job started status
*/
public static IngestJobFinishedStatus ingestFinishedStatus(IngestJob job, RecordsProcessedSummary summary, int numFilesWrittenByJob) {
public static IngestJobFinishedStatus ingestFinishedStatus(RecordsProcessedSummary summary, int numFilesWrittenByJob) {
return IngestJobFinishedStatus.updateTimeAndSummary(defaultUpdateTime(summary.getFinishTime()), summary)
.committedBySeparateFileUpdates(false)
.numFilesWrittenByJob(numFilesWrittenByJob)
Expand Down

0 comments on commit 8f6d452

Please sign in to comment.