File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
src/main/java/com/google/firebase/firestore Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
* [ fixed] Implement equals method on Filter class. [ #5210 ] ( //github.com/firebase/firebase-android-sdk/issues/5210 )
3
+ * [ feature] Add option to allow SDK create cache indexes automatically to improve query execution locally. [ ` db.getPersistentCacheIndexManager().enableIndexAutoCreation() ` ] ( //github.com/firebase/firebase-android-sdk/pull/4987 )
3
4
4
5
# 24.7.0
5
6
* [ feature] Expose MultiDb support in API. [ #4015 ] ( //github.com/firebase/firebase-android-sdk/issues/4015 )
Original file line number Diff line number Diff line change @@ -189,6 +189,7 @@ package com.google.firebase.firestore {
189
189
method @NonNull public static com.google.firebase.firestore.FirebaseFirestore getInstance(@NonNull String);
190
190
method @NonNull public static com.google.firebase.firestore.FirebaseFirestore getInstance(@NonNull com.google.firebase.FirebaseApp, @NonNull String);
191
191
method @NonNull public com.google.android.gms.tasks.Task<com.google.firebase.firestore.Query> getNamedQuery(@NonNull String);
192
+ method @Nullable public com.google.firebase.firestore.PersistentCacheIndexManager getPersistentCacheIndexManager();
192
193
method @NonNull public com.google.firebase.firestore.LoadBundleTask loadBundle(@NonNull java.io.InputStream);
193
194
method @NonNull public com.google.firebase.firestore.LoadBundleTask loadBundle(@NonNull byte[]);
194
195
method @NonNull public com.google.firebase.firestore.LoadBundleTask loadBundle(@NonNull java.nio.ByteBuffer);
@@ -357,6 +358,12 @@ package com.google.firebase.firestore {
357
358
method public void onProgress(@NonNull ProgressT);
358
359
}
359
360
361
+ public final class PersistentCacheIndexManager {
362
+ method public void deleteAllIndexes();
363
+ method public void disableIndexAutoCreation();
364
+ method public void enableIndexAutoCreation();
365
+ }
366
+
360
367
public final class PersistentCacheSettings implements com.google.firebase.firestore.LocalCacheSettings {
361
368
method public long getSizeBytes();
362
369
method @NonNull public static com.google.firebase.firestore.PersistentCacheSettings.Builder newBuilder();
Original file line number Diff line number Diff line change 23
23
import androidx .annotation .Keep ;
24
24
import androidx .annotation .NonNull ;
25
25
import androidx .annotation .Nullable ;
26
- import androidx .annotation .RestrictTo ;
27
26
import androidx .annotation .VisibleForTesting ;
28
27
import com .google .android .gms .tasks .Task ;
29
28
import com .google .android .gms .tasks .TaskCompletionSource ;
@@ -356,7 +355,11 @@ public FirebaseApp getApp() {
356
355
* @param json The JSON format exported by the Firebase CLI.
357
356
* @return A task that resolves once all indices are successfully configured.
358
357
* @throws IllegalArgumentException if the JSON format is invalid
358
+ * @deprecated Instead of creating cache indexes manually, consider using {@link
359
+ * PersistentCacheIndexManager#enableIndexAutoCreation()} to let SDK decide whether cache
360
+ * indexed should be created for query running locally.
359
361
*/
362
+ @ Deprecated
360
363
@ PreviewApi
361
364
@ NonNull
362
365
public Task <Void > setIndexConfiguration (@ NonNull String json ) {
@@ -412,9 +415,6 @@ public Task<Void> setIndexConfiguration(@NonNull String json) {
412
415
* @return The {@code PersistentCacheIndexManager} instance or null if local persistent storage is
413
416
* not in use.
414
417
*/
415
- // TODO(csi): Remove the `hide` and scope annotations.
416
- /** @hide */
417
- @ RestrictTo (RestrictTo .Scope .LIBRARY )
418
418
@ Nullable
419
419
public synchronized PersistentCacheIndexManager getPersistentCacheIndexManager () {
420
420
ensureClientConfigured ();
Original file line number Diff line number Diff line change 24
24
*
25
25
* <p>To use, call {@link FirebaseFirestore#getPersistentCacheIndexManager()} to get an instance.
26
26
*/
27
- // TODO(csi): Remove the `hide` and scope annotations.
28
- /** @hide */
29
- @ RestrictTo (RestrictTo .Scope .LIBRARY )
30
27
public final class PersistentCacheIndexManager {
31
28
@ NonNull private FirestoreClient client ;
32
29
30
+ /** @hide */
31
+ @ RestrictTo (RestrictTo .Scope .LIBRARY )
33
32
PersistentCacheIndexManager (FirestoreClient client ) {
34
33
this .client = client ;
35
34
}
You can’t perform that action at this time.
0 commit comments