Skip to content
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

CosmosQueryExecutionContextFactory Refactory #988

Merged
merged 37 commits into from
Nov 18, 2019

Conversation

bchong95
Copy link
Contributor

CosmosQueryExecutionContextFactory Refactory

Description

CosmosQueryExecutionContextFactory was a class that was hard to reason over, had a lot of state, and was trying to do multiple things.

The first change was that CosmosQueryExecutionContextFactory is now actually a factory and not an instance of the CosmosQueryExecutionContext this eliminates a lot of state being mutated. Along with that I made InputParameters fully immutable.

The second change was to break down the 3 things the factory was handling:

  1. Gathering arguments to create PipelineQueryExecutionContext.
  2. Deferring creation until ExecuteNextAsync is called.
  3. Recreating the context on NameCacheIsStale exceptions.

into 3 separate classes

  1. CosmosQueryExecutionContextFactory
  2. LazyCosmosQueryExecutionContextFactory
  3. CosmosQueryExecutionContextWithNameCacheIsStaleRetry

changelog.md Outdated Show resolved Hide resolved
sboshra
sboshra previously approved these changes Nov 15, 2019
Copy link
Contributor

@sboshra sboshra left a comment

Choose a reason for hiding this comment

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

:shipit:

@sboshra sboshra merged commit 6c34648 into master Nov 18, 2019
@sboshra sboshra deleted the users/brchon/ImmutableQueryFactory branch November 18, 2019 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants