@@ -126,7 +126,7 @@ private void addDocument(Document... docs) {
126
126
});
127
127
}
128
128
129
- private <T > T expectOptimizedCollectionQuery (Callable <T > c ) throws Exception {
129
+ private <T > T expectOptimizedCollectionScan (Callable <T > c ) throws Exception {
130
130
try {
131
131
expectFullCollectionScan = false ;
132
132
return c .call ();
@@ -135,7 +135,7 @@ private <T> T expectOptimizedCollectionQuery(Callable<T> c) throws Exception {
135
135
}
136
136
}
137
137
138
- private <T > T expectFullCollectionQuery (Callable <T > c ) throws Exception {
138
+ private <T > T expectFullCollectionScan (Callable <T > c ) throws Exception {
139
139
try {
140
140
expectFullCollectionScan = true ;
141
141
return c .call ();
@@ -167,7 +167,7 @@ public void usesTargetMappingForInitialView() throws Exception {
167
167
persistQueryMapping (MATCHING_DOC_A .getKey (), MATCHING_DOC_B .getKey ());
168
168
169
169
DocumentSet docs =
170
- expectOptimizedCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
170
+ expectOptimizedCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
171
171
assertEquals (docSet (query .comparator (), MATCHING_DOC_A , MATCHING_DOC_B ), docs );
172
172
}
173
173
@@ -182,7 +182,7 @@ public void filtersNonMatchingInitialResults() throws Exception {
182
182
addDocument (PENDING_NON_MATCHING_DOC_A );
183
183
184
184
DocumentSet docs =
185
- expectOptimizedCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
185
+ expectOptimizedCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
186
186
assertEquals (docSet (query .comparator (), MATCHING_DOC_B ), docs );
187
187
}
188
188
@@ -194,27 +194,27 @@ public void includesChangesSinceInitialResults() throws Exception {
194
194
persistQueryMapping (MATCHING_DOC_A .getKey (), MATCHING_DOC_B .getKey ());
195
195
196
196
DocumentSet docs =
197
- expectOptimizedCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
197
+ expectOptimizedCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
198
198
assertEquals (docSet (query .comparator (), MATCHING_DOC_A , MATCHING_DOC_B ), docs );
199
199
200
200
addDocument (UPDATED_MATCHING_DOC_B );
201
201
202
- docs = expectOptimizedCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
202
+ docs = expectOptimizedCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
203
203
assertEquals (docSet (query .comparator (), MATCHING_DOC_A , UPDATED_MATCHING_DOC_B ), docs );
204
204
}
205
205
206
206
@ Test
207
207
public void doesNotUseInitialResultsWithoutLimboFreeSnapshotVersion () throws Exception {
208
208
Query query = query ("coll" ).filter (filter ("matches" , "==" , true ));
209
209
DocumentSet docs =
210
- expectFullCollectionQuery (() -> runQuery (query , MISSING_LAST_LIMBO_FREE_SNAPSHOT ));
210
+ expectFullCollectionScan (() -> runQuery (query , MISSING_LAST_LIMBO_FREE_SNAPSHOT ));
211
211
assertEquals (docSet (query .comparator ()), docs );
212
212
}
213
213
214
214
@ Test
215
215
public void doesNotUseInitialResultsForUnfilteredCollectionQuery () throws Exception {
216
216
Query query = query ("coll" );
217
- DocumentSet docs = expectFullCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
217
+ DocumentSet docs = expectFullCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
218
218
assertEquals (docSet (query .comparator ()), docs );
219
219
}
220
220
@@ -229,7 +229,7 @@ public void doesNotUseInitialResultsForLimitQueryWithDocumentRemoval() throws Ex
229
229
230
230
addDocument (MATCHING_DOC_B );
231
231
232
- DocumentSet docs = expectFullCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
232
+ DocumentSet docs = expectFullCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
233
233
assertEquals (docSet (query .comparator (), MATCHING_DOC_B ), docs );
234
234
}
235
235
@@ -248,7 +248,7 @@ public void doesNotUseInitialResultsForLimitToLastQueryWithDocumentRemoval() thr
248
248
249
249
addDocument (MATCHING_DOC_B );
250
250
251
- DocumentSet docs = expectFullCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
251
+ DocumentSet docs = expectFullCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
252
252
assertEquals (docSet (query .comparator (), MATCHING_DOC_B ), docs );
253
253
}
254
254
@@ -268,7 +268,7 @@ public void doesNotUseInitialResultsForLimitQueryWhenLastDocumentHasPendingWrite
268
268
269
269
addDocument (MATCHING_DOC_B );
270
270
271
- DocumentSet docs = expectFullCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
271
+ DocumentSet docs = expectFullCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
272
272
assertEquals (docSet (query .comparator (), MATCHING_DOC_B ), docs );
273
273
}
274
274
@@ -288,7 +288,7 @@ public void doesNotUseInitialResultsForLimitToLastQueryWhenLastDocumentHasPendin
288
288
289
289
addDocument (MATCHING_DOC_B );
290
290
291
- DocumentSet docs = expectFullCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
291
+ DocumentSet docs = expectFullCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
292
292
assertEquals (docSet (query .comparator (), MATCHING_DOC_B ), docs );
293
293
}
294
294
@@ -308,7 +308,7 @@ public void doesNotUseInitialResultsForLimitQueryWhenLastDocumentHasBeenUpdatedO
308
308
309
309
addDocument (MATCHING_DOC_B );
310
310
311
- DocumentSet docs = expectFullCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
311
+ DocumentSet docs = expectFullCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
312
312
assertEquals (docSet (query .comparator (), MATCHING_DOC_B ), docs );
313
313
}
314
314
@@ -328,7 +328,7 @@ public void doesNotUseInitialResultsForLimitToLastQueryWhenFirstDocumentHasBeenU
328
328
329
329
addDocument (MATCHING_DOC_B );
330
330
331
- DocumentSet docs = expectFullCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
331
+ DocumentSet docs = expectFullCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
332
332
assertEquals (docSet (query .comparator (), MATCHING_DOC_B ), docs );
333
333
}
334
334
@@ -347,7 +347,7 @@ public void limitQueriesUseInitialResultsIfLastDocumentInLimitIsUnchanged() thro
347
347
// written prior to query execution still sort after "coll/b"), we should use an Index-Free
348
348
// query.
349
349
DocumentSet docs =
350
- expectOptimizedCollectionQuery (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
350
+ expectOptimizedCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
351
351
assertEquals (
352
352
docSet (
353
353
query .comparator (),
0 commit comments