@@ -92,6 +92,17 @@ public GatewayAddressCache(
92
92
93
93
public Uri ServiceEndpoint => this . serviceEndpoint ;
94
94
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>
95
106
public async Task OpenConnectionsAsync (
96
107
string databaseName ,
97
108
ContainerProperties collection ,
@@ -165,6 +176,10 @@ public async Task OpenConnectionsAsync(
165
176
new PartitionKeyRangeIdentity ( collection . ResourceId , addressInfo . Item1 . PartitionKeyRangeId ) ,
166
177
addressInfo . Item2 ) ;
167
178
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`.
168
183
if ( this . openConnectionsHandler != null && shouldOpenRntbdChannels )
169
184
{
170
185
await this . openConnectionsHandler
0 commit comments