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

ReplicaValidationForOpenConnectionAndInitCaches #4

Open
wants to merge 20 commits into
base: replicaValidationBeforeUse
Choose a base branch
from

Conversation

xinlian12
Copy link
Owner

No description provided.

@@ -898,7 +903,15 @@ private void validateReplicaAddresses(AddressInformation[] addresses) {
Arrays
.stream(addresses)
.map(address -> address.getPhysicalUri())
.filter(addressUri -> addressUri.getHealthStatus() == Uri.HealthStatus.UnhealthyPending)
.filter(addressUri -> this.replicaValidationScopes.contains(addressUri.getHealthStatus()))
.sorted(new Comparator<Uri>() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just my 2 cents: I am not a fan of these stream-based or Linq-based operations liek sorted where it is unclear how the functional requirement is implemented.

Does sorted force using an ordered data structure? or use an unstructured data structure and then apply an order by after all results have been cached - like you would do when sorting the List you get back without this operator.

Perf-wise the latter would probably be better in this case>

Not blocking - and I don't have time to look into what .sorted actually is doing - just raising this as a general issue I have when these operators obfuscate the non-functional side-effects.

Copy link
Collaborator

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

LGTM

alzimmermsft and others added 19 commits September 1, 2022 12:26
Add ServiceProvider Interface to azure-json and azure-xml
Prepare Core Libraries for September 2022 Release
…nostics (Azure#30639)

* mapping of database account to number of clients

* forgot to close object

* added client map to client config tests

* update to use dynamic number of clients as opposed to static since pipelines might affect

* updated to use smoother syntax

* update to use fluent api pattern

* use entryset instead of keyset

* use concurrent hashmap to ensure reads are consistent
* replicaValidationBeforeUse

Co-authored-by: annie-mac <[email protected]>
Co-authored-by: annie-mac <[email protected]>
Use currentContext instead of ContextView
* ConnectionStateListener mark replica as unhealthy instead remove all addresses

Co-authored-by: annie-mac <[email protected]>
Co-authored-by: annie-mac <[email protected]>
xinlian12 pushed a commit that referenced this pull request Apr 28, 2023
…BrokenConnections

Proactive connection management for broken connections
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.

8 participants