Search in sources :

Example 1 with SQLitePersistence

use of com.google.firebase.firestore.local.SQLitePersistence in project firebase-android-sdk by firebase.

the class SQLiteComponentProvider method createGarbageCollectionScheduler.

@Override
protected Scheduler createGarbageCollectionScheduler(Configuration configuration) {
    LruDelegate lruDelegate = ((SQLitePersistence) getPersistence()).getReferenceDelegate();
    LruGarbageCollector gc = lruDelegate.getGarbageCollector();
    return gc.newScheduler(configuration.getAsyncQueue(), getLocalStore());
}
Also used : LruGarbageCollector(com.google.firebase.firestore.local.LruGarbageCollector) LruDelegate(com.google.firebase.firestore.local.LruDelegate) SQLitePersistence(com.google.firebase.firestore.local.SQLitePersistence)

Example 2 with SQLitePersistence

use of com.google.firebase.firestore.local.SQLitePersistence in project firebase-android-sdk by firebase.

the class SQLiteComponentProvider method createPersistence.

@Override
protected Persistence createPersistence(Configuration configuration) {
    LocalSerializer serializer = new LocalSerializer(new RemoteSerializer(configuration.getDatabaseInfo().getDatabaseId()));
    LruGarbageCollector.Params params = LruGarbageCollector.Params.WithCacheSizeBytes(configuration.getSettings().getCacheSizeBytes());
    return new SQLitePersistence(configuration.getContext(), configuration.getDatabaseInfo().getPersistenceKey(), configuration.getDatabaseInfo().getDatabaseId(), serializer, params);
}
Also used : LruGarbageCollector(com.google.firebase.firestore.local.LruGarbageCollector) RemoteSerializer(com.google.firebase.firestore.remote.RemoteSerializer) SQLitePersistence(com.google.firebase.firestore.local.SQLitePersistence) LocalSerializer(com.google.firebase.firestore.local.LocalSerializer)

Aggregations

LruGarbageCollector (com.google.firebase.firestore.local.LruGarbageCollector)2 SQLitePersistence (com.google.firebase.firestore.local.SQLitePersistence)2 LocalSerializer (com.google.firebase.firestore.local.LocalSerializer)1 LruDelegate (com.google.firebase.firestore.local.LruDelegate)1 RemoteSerializer (com.google.firebase.firestore.remote.RemoteSerializer)1