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

[Internal] Refactoring: Refactors Moving to ValueFactory overloads of ConcurrentDictionary #2852

Merged
merged 4 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ internal Tuple<PartitionKeyRangeIdentity, PartitionAddressInformation> ToPartiti
addressInfo.PhysicalUri);

HashSet<PartitionKeyRangeIdentity> pkRangeIdSet = this.serverPartitionAddressToPkRangeIdMap.GetOrAdd(
new ServerKey(new Uri(addressInfo.PhysicalUri)), new HashSet<PartitionKeyRangeIdentity>());
kirankumarkolli marked this conversation as resolved.
Show resolved Hide resolved
new ServerKey(new Uri(addressInfo.PhysicalUri)),
(_) => new HashSet<PartitionKeyRangeIdentity>());
lock (pkRangeIdSet)
{
pkRangeIdSet.Add(partitionKeyRangeIdentity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public override bool TryMarkEndpointUnavailableForPartitionKeyRange(

PartitionKeyRangeFailoverInfo partionFailover = this.PartitionKeyRangeToLocation.Value.GetOrAdd(
partitionKeyRange,
new PartitionKeyRangeFailoverInfo(failedLocation));
(_) => new PartitionKeyRangeFailoverInfo(failedLocation));

// Will return true if it was able to update to a new region
if (partionFailover.TryMoveNextLocation(
Expand Down