@@ -176,7 +176,7 @@ TEST_F(IndexBackfillerTest, WritesLatestReadTimeToFieldIndexOnCompletion) {
176
176
AddFieldIndex (" coll2" , " bar" );
177
177
AddDoc (" coll1/docA" , Version (10 ), " foo" , 1 );
178
178
AddDoc (" coll2/docA" , Version (20 ), " bar" , 1 );
179
- int documents_processed = local_store_.Backfill ();
179
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
180
180
ASSERT_EQ (2 , documents_processed);
181
181
182
182
auto field_index1 = index_manager_->GetFieldIndexes (" coll1" ).at (0 );
@@ -189,7 +189,7 @@ TEST_F(IndexBackfillerTest, WritesLatestReadTimeToFieldIndexOnCompletion) {
189
189
AddDoc (" coll2/docB" , Version (60 ), " bar" , 1 );
190
190
AddDoc (" coll2/docC" , Version (60 , 10 ), " bar" , 1 );
191
191
192
- documents_processed = local_store_.Backfill ();
192
+ documents_processed = static_cast < int >( local_store_.Backfill () );
193
193
ASSERT_EQ (4 , documents_processed);
194
194
195
195
field_index1 = index_manager_->GetFieldIndexes (" coll1" ).at (0 );
@@ -205,7 +205,7 @@ TEST_F(IndexBackfillerTest, FetchesDocumentsAfterEarliestReadTime) {
205
205
206
206
// Documents before read time should not be fetched.
207
207
AddDoc (" coll1/docA" , Version (9 ), " foo" , 1 );
208
- int documents_processed = local_store_.Backfill ();
208
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
209
209
ASSERT_EQ (0 , documents_processed);
210
210
211
211
// Read time should be the highest read time from the cache.
@@ -217,7 +217,7 @@ TEST_F(IndexBackfillerTest, FetchesDocumentsAfterEarliestReadTime) {
217
217
// Documents that are after the earliest read time
218
218
// but before field index read time are fetched.
219
219
AddDoc (" coll1/docB" , Version (19 ), " boo" , 1 );
220
- documents_processed = local_store_.Backfill ();
220
+ documents_processed = static_cast < int >( local_store_.Backfill () );
221
221
ASSERT_EQ (1 , documents_processed);
222
222
223
223
// Field indexes should now hold the latest read time
@@ -233,7 +233,7 @@ TEST_F(IndexBackfillerTest, WritesIndexEntries) {
233
233
AddDoc (" coll2/docA" , Version (10 ), " bar" , 1 );
234
234
AddDoc (" coll2/docB" , Version (10 ), " car" , 1 );
235
235
236
- int documents_processed = local_store_.Backfill ();
236
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
237
237
ASSERT_EQ (4 , documents_processed);
238
238
}
239
239
@@ -245,12 +245,12 @@ TEST_F(IndexBackfillerTest, WritesOldestDocumentFirst) {
245
245
AddDoc (" coll1/docB" , Version (3 ), " foo" , 1 );
246
246
AddDoc (" coll1/docC" , Version (10 ), " foo" , 1 );
247
247
248
- int documents_processed = local_store_.Backfill ();
248
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
249
249
ASSERT_EQ (2 , documents_processed);
250
250
251
251
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" });
252
252
253
- documents_processed = local_store_.Backfill ();
253
+ documents_processed = static_cast < int >( local_store_.Backfill () );
254
254
ASSERT_EQ (1 , documents_processed);
255
255
256
256
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" , " coll1/docC" });
@@ -264,12 +264,12 @@ TEST_F(IndexBackfillerTest, UsesDocumentKeyOffsetForLargeSnapshots) {
264
264
AddDoc (" coll1/docB" , Version (1 ), " foo" , 1 );
265
265
AddDoc (" coll1/docC" , Version (1 ), " foo" , 1 );
266
266
267
- int documents_processed = local_store_.Backfill ();
267
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
268
268
ASSERT_EQ (2 , documents_processed);
269
269
270
270
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" });
271
271
272
- documents_processed = local_store_.Backfill ();
272
+ documents_processed = static_cast < int >( local_store_.Backfill () );
273
273
ASSERT_EQ (1 , documents_processed);
274
274
275
275
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" , " coll1/docC" });
@@ -290,7 +290,7 @@ TEST_F(IndexBackfillerTest, UpdatesCollectionGroups) {
290
290
ASSERT_TRUE (collection_group.has_value ());
291
291
ASSERT_EQ (" coll1" , collection_group.value ());
292
292
293
- int documents_processed = local_store_.Backfill ();
293
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
294
294
ASSERT_EQ (2 , documents_processed);
295
295
296
296
// Check that coll1 was backfilled and that coll2 is next
@@ -318,7 +318,7 @@ TEST_F(IndexBackfillerTest, PrioritizesNewCollectionGroups) {
318
318
ASSERT_TRUE (collection_group.has_value ());
319
319
ASSERT_EQ (" coll3" , collection_group.value ());
320
320
321
- int documents_processed = local_store_.Backfill ();
321
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
322
322
ASSERT_EQ (1 , documents_processed);
323
323
324
324
VerifyQueryResults (" coll3" , {" coll3/doc" });
@@ -334,7 +334,7 @@ TEST_F(IndexBackfillerTest, WritesUntilCap) {
334
334
AddDoc (" coll2/docA" , Version (30 ), " foo" , 1 );
335
335
AddDoc (" coll2/docA" , Version (40 ), " foo" , 1 );
336
336
337
- int documents_processed = local_store_.Backfill ();
337
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
338
338
ASSERT_EQ (3 , documents_processed);
339
339
340
340
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" });
@@ -345,13 +345,13 @@ TEST_F(IndexBackfillerTest, UsesLatestReadTimeForEmptyCollections) {
345
345
AddFieldIndex (" coll" , " foo" , Version (1 ));
346
346
AddDoc (" readtime/doc" , Version (1 ), " foo" , 1 );
347
347
348
- int documents_processed = local_store_.Backfill ();
348
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
349
349
ASSERT_EQ (0 , documents_processed);
350
350
351
351
AddDoc (" coll/ignored" , Version (2 ), " foo" , 1 );
352
352
AddDoc (" coll/added" , Version (3 ), " foo" , 1 );
353
353
354
- documents_processed = local_store_.Backfill ();
354
+ documents_processed = static_cast < int >( local_store_.Backfill () );
355
355
ASSERT_EQ (2 , documents_processed);
356
356
}
357
357
@@ -364,11 +364,11 @@ TEST_F(IndexBackfillerTest, HandlesLocalMutationsAfterRemoteDocs) {
364
364
AddDoc (" coll1/docC" , Version (30 ), " foo" , 1 );
365
365
AddSetMutationsToOverlay (1 , {" coll1/docD" });
366
366
367
- int documents_processed = local_store_.Backfill ();
367
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
368
368
ASSERT_EQ (2 , documents_processed);
369
369
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" });
370
370
371
- documents_processed = local_store_.Backfill ();
371
+ documents_processed = static_cast < int >( local_store_.Backfill () );
372
372
ASSERT_EQ (2 , documents_processed);
373
373
VerifyQueryResults (" coll1" ,
374
374
{" coll1/docA" , " coll1/docB" , " coll1/docC" , " coll1/docD" });
@@ -383,13 +383,13 @@ TEST_F(IndexBackfillerTest,
383
383
AddSetMutationsToOverlay (3 , {" coll1/docC" });
384
384
AddSetMutationsToOverlay (4 , {" coll1/docD" });
385
385
386
- int documents_processed = local_store_.Backfill ();
386
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
387
387
ASSERT_EQ (2 , documents_processed);
388
388
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" });
389
389
auto field_index = index_manager_->GetFieldIndexes (" coll1" ).at (0 );
390
390
ASSERT_EQ (2 , field_index.index_state ().index_offset ().largest_batch_id ());
391
391
392
- documents_processed = local_store_.Backfill ();
392
+ documents_processed = static_cast < int >( local_store_.Backfill () );
393
393
ASSERT_EQ (2 , documents_processed);
394
394
VerifyQueryResults (" coll1" ,
395
395
{" coll1/docA" , " coll1/docB" , " coll1/docC" , " coll1/docD" });
@@ -404,7 +404,7 @@ TEST_F(IndexBackfillerTest, MutationFinishesMutationBatchEvenIfItExceedsLimit) {
404
404
AddSetMutationsToOverlay (2 , {" coll1/docB" , " coll1/docC" , " coll1/docD" });
405
405
AddSetMutationsToOverlay (3 , {" coll1/docE" });
406
406
407
- int documents_processed = local_store_.Backfill ();
407
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
408
408
ASSERT_EQ (4 , documents_processed);
409
409
VerifyQueryResults (" coll1" ,
410
410
{" coll1/docA" , " coll1/docB" , " coll1/docC" , " coll1/docD" });
@@ -416,13 +416,13 @@ TEST_F(IndexBackfillerTest, MutationsFromHighWaterMark) {
416
416
AddDoc (" coll1/docA" , Version (10 ), " foo" , 1 );
417
417
AddSetMutationsToOverlay (3 , {" coll1/docB" });
418
418
419
- int documents_processed = local_store_.Backfill ();
419
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
420
420
ASSERT_EQ (2 , documents_processed);
421
421
VerifyQueryResults (" coll1" , {" coll1/docA" , " coll1/docB" });
422
422
423
423
AddSetMutationsToOverlay (1 , {" coll1/docC" });
424
424
AddSetMutationsToOverlay (2 , {" coll1/docD" });
425
- documents_processed = local_store_.Backfill ();
425
+ documents_processed = static_cast < int >( local_store_.Backfill () );
426
426
ASSERT_EQ (0 , documents_processed);
427
427
}
428
428
@@ -432,7 +432,7 @@ TEST_F(IndexBackfillerTest, UpdatesExistingDocToNewValue) {
432
432
433
433
AddDoc (" coll/doc" , Version (10 ), " foo" , 1 );
434
434
435
- int documents_processed = local_store_.Backfill ();
435
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
436
436
ASSERT_EQ (1 , documents_processed);
437
437
VerifyQueryResults (query, {});
438
438
@@ -448,15 +448,15 @@ TEST_F(IndexBackfillerTest, UpdatesDocsThatNoLongerMatch) {
448
448
AddFieldIndex (" coll" , " foo" );
449
449
AddDoc (" coll/doc" , Version (10 ), " foo" , 1 );
450
450
451
- int documents_processed = local_store_.Backfill ();
451
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
452
452
ASSERT_EQ (1 , documents_processed);
453
453
VerifyQueryResults (query, {" coll/doc" });
454
454
455
455
// Update doc to new remote version with new value that doesn't match field
456
456
// index.
457
457
AddDoc (" coll/doc" , Version (40 ), " foo" , -1 );
458
458
459
- documents_processed = local_store_.Backfill ();
459
+ documents_processed = static_cast < int >( local_store_.Backfill () );
460
460
ASSERT_EQ (1 , documents_processed);
461
461
VerifyQueryResults (query, {});
462
462
}
@@ -466,7 +466,7 @@ TEST_F(IndexBackfillerTest, DoesNotProcessSameDocumentTwice) {
466
466
AddDoc (" coll/doc" , Version (5 ), " foo" , 1 );
467
467
AddSetMutationsToOverlay (1 , {" coll/doc" });
468
468
469
- int documents_processed = local_store_.Backfill ();
469
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
470
470
ASSERT_EQ (1 , documents_processed);
471
471
472
472
const auto field_index = index_manager_->GetFieldIndexes (" coll" ).at (0 );
@@ -478,13 +478,13 @@ TEST_F(IndexBackfillerTest, AppliesSetToRemoteDoc) {
478
478
AddFieldIndex (" coll" , " foo" );
479
479
AddDoc (" coll/doc" , Version (5 ), " boo" , 1 );
480
480
481
- int documents_processed = local_store_.Backfill ();
481
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
482
482
ASSERT_EQ (1 , documents_processed);
483
483
484
484
model::Mutation patch = PatchMutation (" coll/doc" , Map (" foo" , " bar" ));
485
485
AddMutationToOverlay (" coll/doc" , patch);
486
486
487
- documents_processed = local_store_.Backfill ();
487
+ documents_processed = static_cast < int >( local_store_.Backfill () );
488
488
ASSERT_EQ (1 , documents_processed);
489
489
490
490
VerifyQueryResults (" coll" , {" coll/doc" });
@@ -498,15 +498,15 @@ TEST_F(IndexBackfillerTest, AppliesPatchToRemoteDoc) {
498
498
AddFieldIndex (" coll" , " b" );
499
499
AddDoc (" coll/doc" , Version (5 ), " a" , 1 );
500
500
501
- int documents_processed = local_store_.Backfill ();
501
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
502
502
ASSERT_EQ (1 , documents_processed);
503
503
504
504
VerifyQueryResults (query_a, {" coll/doc" });
505
505
VerifyQueryResults (query_b, {});
506
506
507
507
model::Mutation patch = PatchMutation (" coll/doc" , Map (" b" , 1 ));
508
508
AddMutationToOverlay (" coll/doc" , patch);
509
- documents_processed = local_store_.Backfill ();
509
+ documents_processed = static_cast < int >( local_store_.Backfill () );
510
510
ASSERT_EQ (1 , documents_processed);
511
511
512
512
VerifyQueryResults (query_a, {" coll/doc" });
@@ -517,12 +517,12 @@ TEST_F(IndexBackfillerTest, AppliesDeleteToRemoteDoc) {
517
517
AddFieldIndex (" coll" , " foo" );
518
518
AddDoc (" coll/doc" , Version (5 ), " foo" , 1 );
519
519
520
- int documents_processed = local_store_.Backfill ();
520
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
521
521
ASSERT_EQ (1 , documents_processed);
522
522
523
523
const model::DeleteMutation delete_mutation = DeleteMutation (" coll/doc" );
524
524
AddMutationToOverlay (" coll/doc" , delete_mutation);
525
- documents_processed = local_store_.Backfill ();
525
+ documents_processed = static_cast < int >( local_store_.Backfill () );
526
526
ASSERT_EQ (1 , documents_processed);
527
527
528
528
persistence_->Run (" BackfillAppliesDeleteToRemoteDoc" , [&] {
@@ -541,13 +541,13 @@ TEST_F(IndexBackfillerTest, ReindexesDocumentsWhenNewIndexIsAdded) {
541
541
AddDoc (" coll/doc1" , Version (1 ), " a" , 1 );
542
542
AddDoc (" coll/doc2" , Version (1 ), " b" , 1 );
543
543
544
- int documents_processed = local_store_.Backfill ();
544
+ int documents_processed = static_cast < int >( local_store_.Backfill () );
545
545
ASSERT_EQ (2 , documents_processed);
546
546
VerifyQueryResults (query_a, {" coll/doc1" });
547
547
VerifyQueryResults (query_b, {});
548
548
549
549
AddFieldIndex (" coll" , " b" );
550
- documents_processed = local_store_.Backfill ();
550
+ documents_processed = static_cast < int >( local_store_.Backfill () );
551
551
ASSERT_EQ (2 , documents_processed);
552
552
553
553
VerifyQueryResults (query_a, {" coll/doc1" });
0 commit comments