Skip to content

Commit f6f3664

Browse files
Review
1 parent ac17fac commit f6f3664

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/local/RemoteDocumentCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ interface RemoteDocumentCache {
7474
* @param collectionGroup The collection group to scan.
7575
* @param offset The offset to start the scan at.
7676
* @param count The number of results to return.
77-
* @return A map with next set of documents.
77+
* @return A newly created map with next set of documents.
7878
*/
7979
Map<DocumentKey, MutableDocument> getAll(String collectionGroup, IndexOffset offset, int count);
8080

@@ -83,7 +83,7 @@ interface RemoteDocumentCache {
8383
*
8484
* @param collection The collection to read.
8585
* @param offset The read time and document key to start scanning at (exclusive).
86-
* @return The set of matching documents.
86+
* @return A newly created map with the set of documents in the collection.
8787
*/
8888
Map<DocumentKey, MutableDocument> getAll(ResourcePath collection, IndexOffset offset);
8989

firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteRemoteDocumentCache.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ private Map<DocumentKey, MutableDocument> getAll(
226226
}
227227

228228
@Override
229-
public Map<DocumentKey, MutableDocument> getAll(
230-
final ResourcePath collection, IndexOffset offset) {
229+
public Map<DocumentKey, MutableDocument> getAll(ResourcePath collection, IndexOffset offset) {
231230
return getAll(Collections.singletonList(collection), offset, Integer.MAX_VALUE);
232231
}
233232

firebase-firestore/src/test/java/com/google/firebase/firestore/local/CountingQueryEngine.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@
3838
class CountingQueryEngine implements QueryEngine {
3939
private final QueryEngine queryEngine;
4040

41-
private final int[] mutationsReadByQuery = new int[] {0};
41+
private final int[] mutationsReadByCollection = new int[] {0};
4242
private final int[] mutationsReadByKey = new int[] {0};
43-
private final int[] documentsReadByQuery = new int[] {0};
43+
private final int[] documentsReadByCollection = new int[] {0};
4444
private final int[] documentsReadByKey = new int[] {0};
4545

4646
CountingQueryEngine(QueryEngine queryEngine) {
4747
this.queryEngine = queryEngine;
4848
}
4949

5050
void resetCounts() {
51-
mutationsReadByQuery[0] = 0;
51+
mutationsReadByCollection[0] = 0;
5252
mutationsReadByKey[0] = 0;
53-
documentsReadByQuery[0] = 0;
53+
documentsReadByCollection[0] = 0;
5454
documentsReadByKey[0] = 0;
5555
}
5656

@@ -84,11 +84,11 @@ QueryEngine getSubject() {
8484
}
8585

8686
/**
87-
* Returns the number of documents returned by the RemoteDocumentCache's
88-
* `getAll()` API (since the last call to `resetCounts()`)
87+
* Returns the number of documents returned by the RemoteDocumentCache's `getAll()` API (since the
88+
* last call to `resetCounts()`)
8989
*/
90-
int getDocumentsReadByColllection() {
91-
return documentsReadByQuery[0];
90+
int getDocumentsReadByCollection() {
91+
return documentsReadByCollection[0];
9292
}
9393

9494
/**
@@ -104,7 +104,7 @@ int getDocumentsReadByKey() {
104104
* `getAllMutationBatchesAffectingQuery()` API (since the last call to `resetCounts()`)
105105
*/
106106
int getMutationsReadByCollection() {
107-
return mutationsReadByQuery[0];
107+
return mutationsReadByCollection[0];
108108
}
109109

110110
/**
@@ -154,14 +154,14 @@ public Map<DocumentKey, MutableDocument> getAll(Iterable<DocumentKey> documentKe
154154
public Map<DocumentKey, MutableDocument> getAll(
155155
String collectionGroup, IndexOffset offset, int count) {
156156
Map<DocumentKey, MutableDocument> result = subject.getAll(collectionGroup, offset, count);
157-
documentsReadByQuery[0] += result.size();
157+
documentsReadByCollection[0] += result.size();
158158
return result;
159159
}
160160

161161
@Override
162162
public Map<DocumentKey, MutableDocument> getAll(ResourcePath collection, IndexOffset offset) {
163163
Map<DocumentKey, MutableDocument> result = subject.getAll(collection, offset);
164-
documentsReadByQuery[0] += result.size();
164+
documentsReadByCollection[0] += result.size();
165165
return result;
166166
}
167167

@@ -249,7 +249,7 @@ public List<MutationBatch> getAllMutationBatchesAffectingDocumentKeys(
249249
@Override
250250
public List<MutationBatch> getAllMutationBatchesAffectingQuery(Query query) {
251251
List<MutationBatch> result = subject.getAllMutationBatchesAffectingQuery(query);
252-
mutationsReadByQuery[0] += result.size();
252+
mutationsReadByCollection[0] += result.size();
253253
return result;
254254
}
255255

firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalStoreTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private void assertRemoteDocumentsRead(int byKey, int byCollection) {
331331
assertEquals(
332332
"Remote documents read (by collection)",
333333
byCollection,
334-
queryEngine.getDocumentsReadByColllection());
334+
queryEngine.getDocumentsReadByCollection());
335335
assertEquals("Remote documents read (by key)", byKey, queryEngine.getDocumentsReadByKey());
336336
}
337337

0 commit comments

Comments
 (0)