use of com.google.firebase.firestore.auth.User in project firebase-android-sdk by firebase.
the class SQLiteOverlayMigrationManager method buildOverlays.
private void buildOverlays() {
db.runTransaction("build overlays", () -> {
Set<String> userIds = getAllUserIds();
RemoteDocumentCache remoteDocumentCache = db.getRemoteDocumentCache();
for (String uid : userIds) {
User user = new User(uid);
MutationQueue mutationQueue = db.getMutationQueue(user, db.getIndexManager(user));
// Get all document keys that have local mutations
Set<DocumentKey> allDocumentKeys = new HashSet<>();
List<MutationBatch> batches = mutationQueue.getAllMutationBatches();
for (MutationBatch batch : batches) {
allDocumentKeys.addAll(batch.getKeys());
}
// Recalculate and save overlays
DocumentOverlayCache documentOverlayCache = db.getDocumentOverlay(user);
LocalDocumentsView localView = new LocalDocumentsView(remoteDocumentCache, mutationQueue, documentOverlayCache, db.getIndexManager(user));
localView.recalculateAndSaveOverlays(allDocumentKeys);
}
removePendingOverlayMigrations();
});
}
Aggregations