@@ -159,7 +159,7 @@ public Map<DocumentKey, MutableDocument> getAll(
159
159
if (collections .isEmpty ()) {
160
160
return Collections .emptyMap ();
161
161
} else if (BINDS_PER_STATEMENT * collections .size () < SQLitePersistence .MAX_ARGS ) {
162
- return getAll (collections , offset , limit , /*filter*/ null );
162
+ return getAll (collections , offset , limit , /*filter*/ null , /*context*/ null );
163
163
} else {
164
164
// We need to fan out our collection scan since SQLite only supports 999 binds per statement.
165
165
Map <DocumentKey , MutableDocument > results = new HashMap <>();
@@ -170,7 +170,8 @@ public Map<DocumentKey, MutableDocument> getAll(
170
170
collections .subList (i , Math .min (collections .size (), i + pageSize )),
171
171
offset ,
172
172
limit ,
173
- /*filter*/ null ));
173
+ /*filter*/ null ,
174
+ /*context*/ null ));
174
175
}
175
176
return firstNEntries (results , limit , IndexOffset .DOCUMENT_COMPARATOR );
176
177
}
@@ -218,27 +219,16 @@ private Map<DocumentKey, MutableDocument> getAll(
218
219
219
220
BackgroundQueue backgroundQueue = new BackgroundQueue ();
220
221
Map <DocumentKey , MutableDocument > results = new HashMap <>();
221
- db .query (sql .toString ())
222
+ int cnt = db .query (sql .toString ())
222
223
.binding (bindVars )
223
- .forEach (
224
- row -> {
225
- processRowInBackground (backgroundQueue , results , row , filter );
226
- if (context != null ) {
227
- context .incrementDocumentReadCount ();
228
- }
229
- });
224
+ .forEach (row -> processRowInBackground (backgroundQueue , results , row , filter ));
225
+ if (context != null ) {
226
+ context .incrementDocumentReadCount (cnt );
227
+ }
230
228
backgroundQueue .drain ();
231
229
return results ;
232
230
}
233
231
234
- private Map <DocumentKey , MutableDocument > getAll (
235
- List <ResourcePath > collections ,
236
- IndexOffset offset ,
237
- int count ,
238
- @ Nullable Predicate <MutableDocument > filter ) {
239
- return getAll (collections , offset , count , filter , /*context*/ null );
240
- }
241
-
242
232
private void processRowInBackground (
243
233
BackgroundQueue backgroundQueue ,
244
234
Map <DocumentKey , MutableDocument > results ,
0 commit comments