From 8f6d452ef7e24bccbbbfd37c18856ced4999d080 Mon Sep 17 00:00:00 2001 From: patchwork01 <110390516+patchwork01@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:00:42 +0000 Subject: [PATCH] Remove IngestJob from ingestFinishedStatus --- .../runner/BulkImportJobDriverIT.java | 22 +++++++++---------- .../runner/BulkImportJobDriverTest.java | 2 +- .../core/job/status/IngestJobStatusTest.java | 2 +- .../job/status/IngestJobStatusTestHelper.java | 6 ++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverIT.java b/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverIT.java index 8e01a66d21..c149561c54 100644 --- a/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverIT.java +++ b/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverIT.java @@ -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())); } @@ -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())); } @@ -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())); } @@ -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())); } @@ -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())); } @@ -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())); } diff --git a/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverTest.java b/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverTest.java index b3895127a4..3ef3be1143 100644 --- a/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverTest.java +++ b/java/bulk-import/bulk-import-runner/src/test/java/sleeper/bulkimport/runner/BulkImportJobDriverTest.java @@ -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()) diff --git a/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTest.java b/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTest.java index 987c546c99..52af7a128f 100644 --- a/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTest.java +++ b/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTest.java @@ -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( diff --git a/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTestHelper.java b/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTestHelper.java index 53f6ea0d1d..37238fa71f 100644 --- a/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTestHelper.java +++ b/java/ingest/ingest-core/src/test/java/sleeper/ingest/core/job/status/IngestJobStatusTestHelper.java @@ -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)