-
Notifications
You must be signed in to change notification settings - Fork 943
Rename QueryData and QueryCache to TargetData and TargetCache #2333
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits, but overall I'm thrilled with this. Thanks for being thorough (updating comments, etc.). Although it can be tedious to do renames like this, I think making this distinction clear results in a substantial improvement to the understandability of the codebase. Thanks!
@@ -161,16 +161,16 @@ export class LocalStore { | |||
*/ | |||
private localViewReferences = new ReferenceSet(); | |||
|
|||
/** Maps a query to the data about that query. */ | |||
private queryCache: QueryCache; | |||
/** Maps a target to the data about that target query. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"target query" => "target" ? Or is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use TargetData
here.
// References for documents sent via Watch are automatically removed | ||
// when we delete a query's target data from the reference delegate. | ||
// when we delete a target's target data from the reference delegate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"target's target data" => "target's data"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
/** | ||
* Adds the given document keys to cached query results of the given target | ||
* Adds the given document keys to cached target query results of the given target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "cached target query results" seems a bit awkward. I'd either stick with "cached query results" or simplify to just "cached results"
And do the same for the following 2 diffs...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -20,59 +20,58 @@ import { Target } from '../core/target'; | |||
import { ListenSequenceNumber, ProtoByteString, TargetId } from '../core/types'; | |||
import { emptyByteString } from '../platform/platform'; | |||
|
|||
/** An enumeration of the different purposes we have for queries. */ | |||
/** An enumeration of the different purposes we have for targets. */ | |||
export enum QueryPurpose { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider renaming to TargetPurpose ? I don't feel strongly, but I think it might make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way is OK to me, I'll just rename it since you have a slight preference.
* LocalStore for user listens and by the SyncEngine for limbo watches. | ||
*/ | ||
readonly targetId: TargetId, | ||
/** The purpose of the query. */ | ||
/** The purpose of the target query. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps "target query" => "target" especially if you rename QueryPurpose to TargetPurpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* was modified. | ||
*/ | ||
readonly sequenceNumber: ListenSequenceNumber, | ||
/** The latest snapshot version seen for this target. */ | ||
readonly snapshotVersion: SnapshotVersion = SnapshotVersion.MIN, | ||
/** | ||
* The maximum snapshot version at which the associated query view | ||
* The maximum snapshot version at which the associated target query view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "target query view" => "view" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick review!
@@ -161,16 +161,16 @@ export class LocalStore { | |||
*/ | |||
private localViewReferences = new ReferenceSet(); | |||
|
|||
/** Maps a query to the data about that query. */ | |||
private queryCache: QueryCache; | |||
/** Maps a target to the data about that target query. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use TargetData
here.
// References for documents sent via Watch are automatically removed | ||
// when we delete a query's target data from the reference delegate. | ||
// when we delete a target's target data from the reference delegate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
/** | ||
* Adds the given document keys to cached query results of the given target | ||
* Adds the given document keys to cached target query results of the given target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* LocalStore for user listens and by the SyncEngine for limbo watches. | ||
*/ | ||
readonly targetId: TargetId, | ||
/** The purpose of the query. */ | ||
/** The purpose of the target query. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -20,59 +20,58 @@ import { Target } from '../core/target'; | |||
import { ListenSequenceNumber, ProtoByteString, TargetId } from '../core/types'; | |||
import { emptyByteString } from '../platform/platform'; | |||
|
|||
/** An enumeration of the different purposes we have for queries. */ | |||
/** An enumeration of the different purposes we have for targets. */ | |||
export enum QueryPurpose { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way is OK to me, I'll just rename it since you have a slight preference.
* was modified. | ||
*/ | ||
readonly sequenceNumber: ListenSequenceNumber, | ||
/** The latest snapshot version seen for this target. */ | ||
readonly snapshotVersion: SnapshotVersion = SnapshotVersion.MIN, | ||
/** | ||
* The maximum snapshot version at which the associated query view | ||
* The maximum snapshot version at which the associated target query view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
No description provided.