@@ -137,44 +137,51 @@ class JobHistoryHandlerTest {
137
137
.withRecordsEmitted (55L )
138
138
.withBytesEmitted (22L )
139
139
.withRecordsCommitted (55L )
140
- .withBytesCommitted (22L ),
140
+ .withBytesCommitted (22L )
141
+ .withRecordsRejected (3L ),
141
142
List .of (
142
143
new StreamSyncStats ().withStreamNamespace ("ns1" ).withStreamName ("stream1" )
143
144
.withStats (new SyncStats ()
144
145
.withRecordsEmitted (5L )
145
146
.withBytesEmitted (2L )
146
147
.withRecordsCommitted (5L )
147
- .withBytesCommitted (2L )),
148
+ .withBytesCommitted (2L )
149
+ .withRecordsRejected (1L )),
148
150
new StreamSyncStats ().withStreamName ("stream2" )
149
151
.withStats (new SyncStats ()
150
152
.withRecordsEmitted (50L )
151
153
.withBytesEmitted (20L )
152
154
.withRecordsCommitted (50L )
153
- .withBytesCommitted (20L ))));
155
+ .withBytesCommitted (20L )
156
+ .withRecordsRejected (2L ))));
154
157
155
158
private static final AttemptStats SECOND_ATTEMPT_STATS = new AttemptStats (new SyncStats ()
156
159
.withRecordsEmitted (5500L )
157
160
.withBytesEmitted (2200L )
158
161
.withRecordsCommitted (5500L )
159
- .withBytesCommitted (2200L ),
162
+ .withBytesCommitted (2200L )
163
+ .withRecordsRejected (150L ),
160
164
List .of (
161
165
new StreamSyncStats ().withStreamNamespace ("ns1" ).withStreamName ("stream1" )
162
166
.withStats (new SyncStats ()
163
167
.withRecordsEmitted (500L )
164
168
.withBytesEmitted (200L )
165
169
.withRecordsCommitted (500L )
166
- .withBytesCommitted (200L )),
170
+ .withBytesCommitted (200L )
171
+ .withRecordsRejected (50L )),
167
172
new StreamSyncStats ().withStreamName ("stream2" )
168
173
.withStats (new SyncStats ()
169
174
.withRecordsEmitted (5000L )
170
175
.withBytesEmitted (2000L )
171
176
.withRecordsCommitted (5000L )
172
- .withBytesCommitted (2000L ))));
177
+ .withBytesCommitted (2000L )
178
+ .withRecordsRejected (100L ))));
173
179
174
180
private static final io .airbyte .api .model .generated .AttemptStats FIRST_ATTEMPT_STATS_API = new io .airbyte .api .model .generated .AttemptStats ()
175
181
.recordsEmitted (55L )
176
182
.bytesEmitted (22L )
177
- .recordsCommitted (55L );
183
+ .recordsCommitted (55L )
184
+ .recordsRejected (3L );
178
185
179
186
private static final List <AttemptStreamStats > FIRST_ATTEMPT_STREAM_STATS = List .of (
180
187
new AttemptStreamStats ()
@@ -183,18 +190,21 @@ class JobHistoryHandlerTest {
183
190
.stats (new io .airbyte .api .model .generated .AttemptStats ()
184
191
.recordsEmitted (5L )
185
192
.bytesEmitted (2L )
186
- .recordsCommitted (5L )),
193
+ .recordsCommitted (5L )
194
+ .recordsRejected (1L )),
187
195
new AttemptStreamStats ()
188
196
.streamName ("stream2" )
189
197
.stats (new io .airbyte .api .model .generated .AttemptStats ()
190
198
.recordsEmitted (50L )
191
199
.bytesEmitted (20L )
192
- .recordsCommitted (50L )));
200
+ .recordsCommitted (50L )
201
+ .recordsRejected (2L )));
193
202
194
203
private static final io .airbyte .api .model .generated .AttemptStats SECOND_ATTEMPT_STATS_API = new io .airbyte .api .model .generated .AttemptStats ()
195
204
.recordsEmitted (5500L )
196
205
.bytesEmitted (2200L )
197
- .recordsCommitted (5500L );
206
+ .recordsCommitted (5500L )
207
+ .recordsRejected (150L );
198
208
199
209
private static final List <AttemptStreamStats > SECOND_ATTEMPT_STREAM_STATS = List .of (
200
210
new AttemptStreamStats ()
@@ -203,13 +213,15 @@ class JobHistoryHandlerTest {
203
213
.stats (new io .airbyte .api .model .generated .AttemptStats ()
204
214
.recordsEmitted (500L )
205
215
.bytesEmitted (200L )
206
- .recordsCommitted (500L )),
216
+ .recordsCommitted (500L )
217
+ .recordsRejected (50L )),
207
218
new AttemptStreamStats ()
208
219
.streamName ("stream2" )
209
220
.stats (new io .airbyte .api .model .generated .AttemptStats ()
210
221
.recordsEmitted (5000L )
211
222
.bytesEmitted (2000L )
212
- .recordsCommitted (5000L )));
223
+ .recordsCommitted (5000L )
224
+ .recordsRejected (100L )));
213
225
214
226
private ConnectionService connectionService ;
215
227
private SourceHandler sourceHandler ;
@@ -356,28 +368,32 @@ void testListJobs() throws IOException {
356
368
.recordsEmitted (5550L )
357
369
.bytesEmitted (2220L )
358
370
.recordsCommitted (5550L )
359
- .bytesCommitted (2220L ))
371
+ .bytesCommitted (2220L )
372
+ .recordsRejected (152L ))
360
373
.streamAggregatedStats (List .of (
361
374
new StreamStats ()
362
375
.streamName ("stream2" )
363
376
.recordsEmitted (5050L )
364
377
.bytesEmitted (2020L )
365
378
.recordsCommitted (5050L )
366
- .bytesCommitted (2020L ),
379
+ .bytesCommitted (2020L )
380
+ .recordsRejected (102L ),
367
381
new StreamStats ()
368
382
.streamName ("stream1" )
369
383
.streamNamespace ("ns1" )
370
384
.recordsEmitted (500L )
371
385
.bytesEmitted (200L )
372
386
.recordsCommitted (500L )
373
- .bytesCommitted (200L ))))
387
+ .bytesCommitted (200L )
388
+ .recordsRejected (50L ))))
374
389
.attempts (List .of (expectedAttemptRead1 , expectedAttemptRead2 ));
375
390
final var latestJobWithAttemptRead = new JobWithAttemptsRead ().job (toJobInfo (latestJobNoAttempt )
376
391
.aggregatedStats (new JobAggregatedStats ()
377
392
.recordsEmitted (0L )
378
393
.bytesEmitted (0L )
379
394
.recordsCommitted (0L )
380
- .bytesCommitted (0L ))
395
+ .bytesCommitted (0L )
396
+ .recordsRejected (0L ))
381
397
.streamAggregatedStats (Collections .emptyList ()))
382
398
.attempts (Collections .emptyList ());
383
399
final JobReadList expectedJobReadList =
@@ -433,51 +449,58 @@ void testListJobsFor() throws IOException {
433
449
.recordsEmitted (55L )
434
450
.bytesEmitted (22L )
435
451
.recordsCommitted (55L )
436
- .bytesCommitted (22L ))
452
+ .bytesCommitted (22L )
453
+ .recordsRejected (3L ))
437
454
.streamAggregatedStats (List .of (
438
455
new StreamStats ()
439
456
.streamName ("stream2" )
440
457
.recordsEmitted (50L )
441
458
.bytesEmitted (20L )
442
459
.recordsCommitted (50L )
443
- .bytesCommitted (20L ),
460
+ .bytesCommitted (20L )
461
+ .recordsRejected (2L ),
444
462
new StreamStats ()
445
463
.streamName ("stream1" )
446
464
.streamNamespace ("ns1" )
447
465
.recordsEmitted (5L )
448
466
.bytesEmitted (2L )
449
467
.recordsCommitted (5L )
450
- .bytesCommitted (2L ))))
468
+ .bytesCommitted (2L )
469
+ .recordsRejected (1L ))))
451
470
.attempts (List .of (toAttemptRead (testJobAttempt ).totalStats (FIRST_ATTEMPT_STATS_API ).streamStats (FIRST_ATTEMPT_STREAM_STATS )));
452
471
final var secondJobWithAttemptRead =
453
472
new JobWithAttemptsRead ().job (toJobInfo (secondJob )
454
473
.aggregatedStats (new JobAggregatedStats ()
455
474
.recordsEmitted (55L )
456
475
.bytesEmitted (22L )
457
476
.recordsCommitted (55L )
458
- .bytesCommitted (22L ))
477
+ .bytesCommitted (22L )
478
+ .recordsRejected (3L ))
459
479
.streamAggregatedStats (List .of (
460
480
new StreamStats ()
461
481
.streamName ("stream2" )
462
482
.recordsEmitted (50L )
463
483
.bytesEmitted (20L )
464
484
.recordsCommitted (50L )
465
- .bytesCommitted (20L ),
485
+ .bytesCommitted (20L )
486
+ .recordsRejected (2L ),
466
487
new StreamStats ()
467
488
.streamName ("stream1" )
468
489
.streamNamespace ("ns1" )
469
490
.recordsEmitted (5L )
470
491
.bytesEmitted (2L )
471
492
.recordsCommitted (5L )
472
- .bytesCommitted (2L ))))
493
+ .bytesCommitted (2L )
494
+ .recordsRejected (1L ))))
473
495
.attempts (
474
496
List .of (toAttemptRead (secondJobAttempt ).totalStats (FIRST_ATTEMPT_STATS_API ).streamStats (FIRST_ATTEMPT_STREAM_STATS )));
475
497
final var latestJobWithAttemptRead = new JobWithAttemptsRead ().job (toJobInfo (latestJob )
476
498
.aggregatedStats (new JobAggregatedStats ()
477
499
.recordsEmitted (0L )
478
500
.bytesEmitted (0L )
479
501
.recordsCommitted (0L )
480
- .bytesCommitted (0L ))
502
+ .bytesCommitted (0L )
503
+ .recordsRejected (0L ))
481
504
.streamAggregatedStats (Collections .emptyList ())).attempts (Collections .emptyList ());
482
505
final JobReadList expectedJobReadList =
483
506
new JobReadList ().jobs (List .of (latestJobWithAttemptRead , secondJobWithAttemptRead , firstJobWithAttemptRead )).totalJobCount (3L );
@@ -522,29 +545,33 @@ void testListJobsIncludingJobId() throws IOException {
522
545
.recordsEmitted (55L )
523
546
.bytesEmitted (22L )
524
547
.recordsCommitted (55L )
525
- .bytesCommitted (22L ))
548
+ .bytesCommitted (22L )
549
+ .recordsRejected (3L ))
526
550
.streamAggregatedStats (List .of (
527
551
new StreamStats ()
528
552
.streamName ("stream2" )
529
553
.recordsEmitted (50L )
530
554
.bytesEmitted (20L )
531
555
.recordsCommitted (50L )
532
- .bytesCommitted (20L ),
556
+ .bytesCommitted (20L )
557
+ .recordsRejected (2L ),
533
558
new StreamStats ()
534
559
.streamName ("stream1" )
535
560
.streamNamespace ("ns1" )
536
561
.recordsEmitted (5L )
537
562
.bytesEmitted (2L )
538
563
.recordsCommitted (5L )
539
- .bytesCommitted (2L ))))
564
+ .bytesCommitted (2L )
565
+ .recordsRejected (1L ))))
540
566
.attempts (List .of (toAttemptRead (
541
567
testJobAttempt ).totalStats (FIRST_ATTEMPT_STATS_API ).streamStats (FIRST_ATTEMPT_STREAM_STATS )));
542
568
final var latestJobWithAttemptRead = new JobWithAttemptsRead ().job (toJobInfo (latestJobNoAttempt )
543
569
.aggregatedStats (new JobAggregatedStats ()
544
570
.recordsEmitted (0L )
545
571
.bytesEmitted (0L )
546
572
.recordsCommitted (0L )
547
- .bytesCommitted (0L ))
573
+ .bytesCommitted (0L )
574
+ .recordsRejected (0L ))
548
575
.streamAggregatedStats (Collections .emptyList ()))
549
576
.attempts (Collections .emptyList ());
550
577
final JobReadList expectedJobReadList =
@@ -900,6 +927,7 @@ void testGetJobInfoWithoutLogs() throws IOException {
900
927
final JobInfoRead resultingJobInfo = jobHistoryHandler .getJobInfoWithoutLogs (JOB_ID );
901
928
assertEquals (resultingJobInfo .getJob ().getAggregatedStats ().getBytesCommitted (), FIRST_ATTEMPT_STATS .combinedStats ().getBytesCommitted ());
902
929
assertEquals (resultingJobInfo .getJob ().getAggregatedStats ().getRecordsCommitted (), FIRST_ATTEMPT_STATS .combinedStats ().getRecordsCommitted ());
930
+ assertEquals (resultingJobInfo .getJob ().getAggregatedStats ().getRecordsRejected (), FIRST_ATTEMPT_STATS .combinedStats ().getRecordsRejected ());
903
931
904
932
}
905
933
0 commit comments