Skip to content

Optimize bloom filter application #6992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 9, 2023
Prev Previous commit
Next Next commit
use getter for databaseId
milaGGL committed Feb 1, 2023
commit 24ce794caca205d9ea143d6964fac96251270ccb
7 changes: 6 additions & 1 deletion packages/firestore/src/remote/datastore.ts
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

import { CredentialsProvider } from '../api/credentials';
import { User } from '../auth/user';
import { DatabaseId } from '../core/database_info';
import { Query, queryToTarget } from '../core/query';
import { Document } from '../model/document';
import { DocumentKey } from '../model/document_key';
@@ -59,7 +60,7 @@ import {
*/
export abstract class Datastore {
abstract terminate(): void;
abstract serializer: JsonProtoSerializer;
abstract databaseId: DatabaseId;
}

/**
@@ -78,6 +79,10 @@ class DatastoreImpl extends Datastore {
super();
}

get databaseId(): DatabaseId {
return this.serializer.databaseId
}

verifyInitialized(): void {
debugAssert(!!this.connection, 'Datastore.start() not called');
if (this.terminated) {
2 changes: 1 addition & 1 deletion packages/firestore/src/remote/remote_store.ts
Original file line number Diff line number Diff line change
@@ -378,7 +378,7 @@ function startWatchStream(remoteStoreImpl: RemoteStoreImpl): void {
getTargetDataForTarget: targetId =>
remoteStoreImpl.listenTargets.get(targetId) || null
},
remoteStoreImpl.datastore.serializer.databaseId
remoteStoreImpl.datastore.databaseId
);
ensureWatchStream(remoteStoreImpl).start();
remoteStoreImpl.onlineStateTracker.handleWatchStreamStart();