Skip to content

Commit 39ac067

Browse files
committed
Cosmetic changes to add inline code comments.
1 parent 8495cf6 commit 39ac067

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs

+15
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ public GatewayAddressCache(
9292

9393
public Uri ServiceEndpoint => this.serviceEndpoint;
9494

95+
/// <summary>
96+
/// Gets the address information from the gateway and sets them into the async non blocking cache for later lookup.
97+
/// Additionally attempts to establish Rntbd connections to the backend replicas based on `shouldOpenRntbdChannels`
98+
/// boolean flag.
99+
/// </summary>
100+
/// <param name="databaseName">A string containing the database name.</param>
101+
/// <param name="collection">An instance of <see cref="ContainerProperties"/> containing the collection properties.</param>
102+
/// <param name="partitionKeyRangeIdentities">A read only list containing the partition key range identities.</param>
103+
/// <param name="shouldOpenRntbdChannels">A boolean flag indicating whether Rntbd connections are required to be
104+
/// established to the backend replica nodes.</param>
105+
/// <param name="cancellationToken">An instance of <see cref="CancellationToken"/>.</param>
95106
public async Task OpenConnectionsAsync(
96107
string databaseName,
97108
ContainerProperties collection,
@@ -165,6 +176,10 @@ public async Task OpenConnectionsAsync(
165176
new PartitionKeyRangeIdentity(collection.ResourceId, addressInfo.Item1.PartitionKeyRangeId),
166177
addressInfo.Item2);
167178

179+
// The `shouldOpenRntbdChannels` boolean flag indicates whether the SDK should establish Rntbd connections to the
180+
// backend replica nodes. For the `CosmosClient.CreateAndInitializeAsync()` flow, the flag should be passed as
181+
// `true` so that the Rntbd connections to the backend replicas could be established deterministically. For any
182+
// other flow, the flag should be passed as `false`.
168183
if (this.openConnectionsHandler != null && shouldOpenRntbdChannels)
169184
{
170185
await this.openConnectionsHandler

0 commit comments

Comments
 (0)