use of com.google.firebase.firestore.local.LocalSerializer in project firebase-android-sdk by firebase.
the class MemorySpecTest method initializeComponentProvider.
@Override
protected MemoryComponentProvider initializeComponentProvider(ComponentProvider.Configuration configuration, boolean garbageCollectionEnabled) {
MemoryComponentProvider provider = new MemoryComponentProvider() {
@Override
protected Persistence createPersistence(Configuration configuration) {
if (garbageCollectionEnabled) {
return MemoryPersistence.createEagerGcMemoryPersistence();
} else {
DatabaseId databaseId = DatabaseId.forProject("projectId");
LocalSerializer serializer = new LocalSerializer(new RemoteSerializer(databaseId));
return MemoryPersistence.createLruGcMemoryPersistence(LruGarbageCollector.Params.Default(), serializer);
}
}
};
provider.initialize(configuration);
return provider;
}
use of com.google.firebase.firestore.local.LocalSerializer 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);
}
Aggregations