[Internal] Direct Package Upgrade: Refactors Code to Bump Up `Cosmos.Direct` Package to `3.31.2` (#3918)

* Code changes to bump up the direct version.

* Code changes to mark the Israel Central region as public.

* Code changes to update contracts.

* Code changes to fix test failure. Some clean ups.

* Code changes to add detailed message for open channels count.
This commit is contained in:
Debdatta Kunda 2023-06-16 17:29:42 -07:00 коммит произвёл GitHub
Родитель 8684535d23
Коммит 69702227d9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -3,7 +3,7 @@
<ClientOfficialVersion>3.34.0</ClientOfficialVersion>
<ClientPreviewVersion>3.34.0</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview</ClientPreviewSuffixVersion>
<DirectVersion>3.31.1</DirectVersion>
<DirectVersion>3.31.2</DirectVersion>
<EncryptionOfficialVersion>2.0.2</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.0.2</EncryptionPreviewVersion>
<EncryptionPreviewSuffixVersion>preview</EncryptionPreviewSuffixVersion>

Просмотреть файл

@ -359,5 +359,10 @@ namespace Microsoft.Azure.Cosmos
/// Name of the Azure Italy North region in the Azure Cosmos DB service.
/// </summary>
public const string ItalyNorth = "Italy North";
/// <summary>
/// Name of the Azure Israel Central region in the Azure Cosmos DB service.
/// </summary>
public const string IsraelCentral = "Israel Central";
}
}

Просмотреть файл

@ -205,7 +205,7 @@
public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldOpenRntbdConnectionsToBackendReplicas()
{
// Arrange.
int httpCallsMade = 0;
int httpCallsMade = 0, maxRequestsPerConnection = 6;
HttpClientHandlerHelper httpClientHandlerHelper = new ()
{
RequestCallBack = (request, cancellationToken) =>
@ -227,6 +227,7 @@
{
HttpClientFactory = () => new HttpClient(httpClientHandlerHelper),
ConnectionMode = ConnectionMode.Direct,
MaxRequestsPerTcpConnection = maxRequestsPerConnection,
};
// Act.
@ -275,8 +276,11 @@
.GetValue(loadBalancingPartition);
Assert.IsNotNull(openChannels);
Assert.AreEqual(30, channelCapacity);
Assert.AreEqual(1, openChannels.Count);
Assert.AreEqual(48, openChannels.Count, "Here the expected value 48 rather explains how many time we call the" +
"LoadBalancingPartition.OpenChannelAsync(). The emulator by default returns 12 partitions, and each partition has 4 replicas," +
"and by behavior the emulator uses the same URI for eac of these replica, hence 12 * 4 = 48 times we call the OpenChannelAsync()." +
"In ideal world, the value should be 1, because for each unique URI, the OpenChannelAsync() call will just be 1.");
Assert.AreEqual(openChannels.Count * maxRequestsPerConnection, channelCapacity);
Documents.Rntbd.LbChannelState channelState = openChannels.First();

Просмотреть файл

@ -6680,6 +6680,11 @@
"Attributes": [],
"MethodInfo": "System.String GermanyWestCentral;IsInitOnly:False;IsStatic:True;"
},
"System.String IsraelCentral": {
"Type": "Field",
"Attributes": [],
"MethodInfo": "System.String IsraelCentral;IsInitOnly:False;IsStatic:True;"
},
"System.String ItalyNorth": {
"Type": "Field",
"Attributes": [],