Skip to content

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

Merged
merged 3 commits into from
Nov 5, 2019

Conversation

wu-hui
Copy link
Contributor

@wu-hui wu-hui commented Nov 4, 2019

No description provided.

Copy link
Contributor

@mikelehen mikelehen left a 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. */
Copy link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Contributor

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"

Copy link
Contributor Author

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
Copy link
Contributor

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...

Copy link
Contributor Author

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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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. */
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mikelehen mikelehen assigned wu-hui and unassigned mikelehen Nov 4, 2019
Copy link
Contributor Author

@wu-hui wu-hui left a 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. */
Copy link
Contributor Author

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.
Copy link
Contributor Author

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
Copy link
Contributor Author

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. */
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@wu-hui wu-hui merged commit ed87b76 into master Nov 5, 2019
@Feiyang1 Feiyang1 added this to the next milestone Nov 5, 2019
@firebase firebase locked and limited conversation to collaborators Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants