use of com.google.firebase.firestore.core.MemoryComponentProvider 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;
}
Aggregations