use of com.google.firebase.firestore.remote.Datastore in project firebase-android-sdk by firebase.
the class FirestoreClient method initialize.
private void initialize(Context context, User user, FirebaseFirestoreSettings settings) {
// Note: The initialization work must all be synchronous (we can't dispatch more work) since
// external write/listen operations could get queued to run before that subsequent work
// completes.
Logger.debug(LOG_TAG, "Initializing. user=%s", user.getUid());
Datastore datastore = new Datastore(databaseInfo, asyncQueue, authProvider, appCheckProvider, context, metadataProvider);
ComponentProvider.Configuration configuration = new ComponentProvider.Configuration(context, asyncQueue, databaseInfo, datastore, user, MAX_CONCURRENT_LIMBO_RESOLUTIONS, settings);
ComponentProvider provider = settings.isPersistenceEnabled() ? new SQLiteComponentProvider() : new MemoryComponentProvider();
provider.initialize(configuration);
persistence = provider.getPersistence();
gcScheduler = provider.getGarbageCollectionScheduler();
localStore = provider.getLocalStore();
remoteStore = provider.getRemoteStore();
syncEngine = provider.getSyncEngine();
eventManager = provider.getEventManager();
IndexBackfiller indexBackfiller = provider.getIndexBackfiller();
if (gcScheduler != null) {
gcScheduler.start();
}
if (indexBackfiller != null) {
indexBackfillScheduler = indexBackfiller.getScheduler();
indexBackfillScheduler.start();
}
}
Aggregations